[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: walking a directory tree
- From: Mark Edgar <medgar@...>
- Date: Mon, 18 Dec 2006 15:32:07 -0700
Ken Smith wrote:
I have found myself in a position where I must use Lua to walk a
directory tree and performing some operation on every file. Is there
an idiomatic way to do this in Lua?
Since standard C has no interface for dealing with directories, neither
does core Lua. However, may people have written libraries which include
file system manipulation, including directory iteration.
for name in lfs.dir"/foo" do
for name in posix.files"/foo" do
And there is also the "ex" API:
for entry in os.dir"/foo" do