LuaFileSystem logo
LuaFileSystem Reference Manual
File system library for the Lua programming language

home · introduction · reference · example


Introduction

LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.

LuaFileSystem is free software and uses the same license as Lua 5.0.

Reference

LuaFileSystem offers the following functions:

Example

require"lfs"

function attrdir (path)
    for file in lfs.dir(path) do
        if file ~= "." and file ~= ".." then
            local f = path..'/'..file
            print ("\t "..f)
            local attr = lfs.attributes (f)
            assert (type(attr) == "table")
            if attr.mode == "directory" then
                attrdir (f)
            else
                for name, value in pairs(attr) do
                    print (name, value)
                end
            end
        end
    end
end

attrdir (".")

Contents

home · introduction · reference · example


$Id: manual.html,v 1.5 2004/11/01 15:27:13 tomas Exp $