Expand description
Lua os standard library.
Ports src/loslib.c (430 lines, 12 functions) to Rust.
§Platform access limitations
Several os.* functions require OS-level capabilities. File removal,
rename, command execution, environment lookup, temporary-name generation,
and wall-clock access route through GlobalState hooks supplied by the
embedder where needed for sandboxed/WASM hosts.
Time decomposition (os.date, os.time) requires C-library functions
(gmtime_r, localtime_r, mktime, strftime). Those call sites are
flagged with TODO(port) and the stubs use a zero-initialised TmFields.
Structs§
- TmFields
- Local mirror of C’s
struct tm.
Constants§
- OS_LIB
- Mapping from Lua-visible names to the Rust implementations of each
os.*function.
Functions§
- open_os
- Opens the
oslibrary: creates a new table populated withOS_LIBand leaves it on the stack.
Type Aliases§
- Native
Fn - Type alias for a Lua native function implementation in Rust.