On Sun, Aug 08, 2004 at 01:16:52AM +0000, David Given wrote:
Alex Sandro Queiroz e Silva wrote:
[...]
Just one thing, though. Can I suggest that Lua *must* provide a
directory listing function as part of its core functionality?
You don't have to go back further than a week in the archives to
read about this... :-)
The short summary is that you can't, because there's no standard way of
doing it that's truly portable across all platforms. And, 'all
platforms' includes weird and wacky embedded systems that don't support
any IO.
Let me put it like this: do you use /, \, :, . or <other> to seperate
path elements?
And even more excitingly, do you use / or $ as the root directory, or ..
or ^ to go up a level? :) (RISC OS must have the most bizarre paths
I've ever personally seen. ADFS::HardDisc4.$.Applications.!Zap for
example)
There's a reason the ANSI C library distances itself from directory
structures.