lua-users home
lua-l archive

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

On 8 September 2016 at 01:44, Aapo Talvensaari
<> wrote:
> On 7 September 2016 at 17:53, Daurnimator <> wrote:
>> On 8 September 2016 at 00:40, Dirk Laurie <> wrote:
>> > Every time I require lfs, I ask myself: why is this stuff not in the
>> > os library?
>> Everytime I see the `os` library I ask: why did this come with lua? I
>> always replace it with my own variants anyway.
> Any examples? Lua only or Lua + C module?

Instead of or os.time I use luatz
  - usually I want time more accurate than to the second (this is an
optional part of luatz, and is the only bit that requires C code)
  - timezones are important!
(Infact, usually when someone reaches for `os.time()` they actually
wanted a monotonic clock)

Instead of os.execute I use lua-spawn

os.rename doesn't work across file systems
  - usually just shell out (with lua-spawn) to `mv`

os.getenv isn't powerful enough:
Almost everytime I need it I either need to enumerate all env vars, or
follow it up with a setenv
For setenv, lately I've been using lunix:
Before that, lposix
Before that, lua-ex


Remembering that prompts me: aren't the functions dirk proposes almost
exactly the lua-ex api?
**feelings of deja vu**