Hi,
yesterday, while I was studing Lua, I did this really simple [and
stupid] library:
http://distphylo.svn.sourceforge.net/viewvc/distphylo/trunk/ldirlib/
They have 2 functions: dir:cwd(), returning current working directory
and dir:list(), that returns a table of tables with files names and
yours types.
The example, does exactly what you want, walking by directory.
My 2 cents.
Felipe Albrecht
On 12/19/06, Asko Kauppi <askok@dnainternet.net> wrote:
The 'ex' package was news to me; worth a close look.
There's also a possibility of using 100% Lua code, and os.execute()
call, in an OS independent way. Lumikki has such code within it; see
dirtools.lua if someone's interested.
http://luaforge.net/frs/?group_id=24 (take 0.22 tgz = the latest)
- asko
Ken Smith kirjoitti 19.12.2006 kello 2.09:
> On 12/18/06, Mark Edgar
>> lposix:
>>
>> -- http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lposix
>> require "lposix"
>> for name in posix.files"/foo" do
>> print(name)
>> end
>>
>>
>> And there is also the "ex" API:
>>
>> -- http://lua-users.org/wiki/ExtensionProposal
>> require "ex"
>> for entry in os.dir"/foo" do
>> print(entry.name)
>> end
>
> Thanks Mark. These two libs also look great. At first blush both
> will be good additions to my toolbox in addition to their
ability to
> help me in this case.
>
> Ken Smith