lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Since the last message, I've started making GnuStep binding to Lua. While it offers much more than directory browsing, it offers also that, and does it using a nice enumerator (bound into Lua as a regular for iterator).

There are several points going for GnuStep with Lua:
  - existing API is stable
- designed for a dynamic language (Objective-C), which shows in the API
  - not using much inheritance (which I think is only good)
  - implemented for Linux, Win32, Mac OS X (native), Solaris
- covers the full range of OS necessities: networking, file system, timing, multithreading

It will be released later this spring, already now it feels right, and will offer quite a punch when combined with a language like Lua. In fact, the API suits way better to be used from Lua than Objective- C. String, arrays, garbage collection are way better in Our Language of Love. :)

-asko


Felipe Albrecht kirjoitti 4.1.2007 kello 21.25:

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