lua-users home
lua-l archive

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

Yes, also pulling in another library for basic file operations is not always possible when shipping with minimal builds of Lua.

On Wed, Sep 7, 2016 at 8:10 PM, Dirk Laurie <> wrote:
Every time I require lfs, I ask myself: why is this stuff not in the
os library?

I understand that not all systems support everything that lfs
has. And that Lua is very platform-independent.

But the goal of platform-independence does not stop Lua
from offering os.execute, which invites the user to write
platform-dependent code, and io.popen, which "is system
dependent and is not available on all platforms".

The absence of functions so basic that even CP/M and PC-DOS
had them is the one thing that stops Lua from breaking into
the Perl/Python cartel of scripted system programming.

If all of lfs is too much, here is my order of preference:

1. dir
2. chdir, mkdir, rmdir, currentdir
3. attributes, setmode, touch
4. lock, unlock, lock_dir
5. link, symlinkattributes