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)
Sat, Jan 18, 5:45 PM
Unknown Object (File)
Wed, Jan 8, 9:29 PM
Unknown Object (File)
Fri, Jan 3, 2:00 AM
Unknown Object (File)
Nov 29 2024, 5:51 AM
Unknown Object (File)
Nov 27 2024, 6:44 AM
Unknown Object (File)
Nov 18 2024, 2:18 PM
Unknown Object (File)
Nov 6 2024, 5:03 AM
Unknown Object (File)
Nov 5 2024, 2:51 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.