Page MenuHomeFreeBSD

Lua loader: Add barebones "lfs" module
ClosedPublic

Authored by cem on Feb 17 2018, 9:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 12:59 PM
Unknown Object (File)
Wed, Apr 17, 11:05 AM
Unknown Object (File)
Wed, Apr 17, 11:05 AM
Unknown Object (File)
Jan 28 2024, 12:49 AM
Unknown Object (File)
Jan 8 2024, 10:46 AM
Unknown Object (File)
Dec 24 2023, 5:23 AM
Unknown Object (File)
Dec 24 2023, 5:23 AM
Unknown Object (File)
Dec 20 2023, 6:26 AM
Subscribers
None

Details

Summary

Add a Lua FileSystem module, an emulation of a subset of the permissively
licensed (MIT) Lua library of the same name[0], to our loader's Lua
environment.

[0]: https://github.com/keplerproject/luafilesystem/

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

My lua extension fu is weak, but this looks decent to me.

stand/liblua/lfs.c
325–332 ↗(On Diff #39443)

We need to do this to loader. and os., and maybe check against lua standard libraries to see if there's a more standard set of names if we're off in the weeds.

In D14418#302203, @imp wrote:

My lua extension fu is weak, but this looks decent to me.

Mine too.

stand/liblua/lfs.c
325–332 ↗(On Diff #39443)

Yes, I was about to go ahead and do those cleanups now. :-)

stand/liblua/lfs.c
325–332 ↗(On Diff #39443)

We should do them as modules, like the standard modules, and maybe lfs should be done that way too...

There's a bit of a mismatch between interp_lua stuff an lutils.c lstd.c stuff that likely could benefit from a good going over.

See loadedlibs[] in interp_lua for where we do the standard ones.

stand/liblua/lfs.c
325–332 ↗(On Diff #39443)

Sure, there's room for additional cleanup there. Do you care about the order, cleanup vs adding this module? If I can commit this and the subsequent patch first it keeps my patch stack shorter, which I prefer.

stand/liblua/lfs.c
325–332 ↗(On Diff #39443)

If it's about the same time, I don't care. I just don't want to get a mess and be stuck with it :(

Use loadlibs module registration system.

Remove now useless include

This revision is now accepted and ready to land.Feb 18 2018, 1:11 AM
This revision was automatically updated to reflect the committed changes.