Filesystem library implementation for lua
Ref: https://en.cppreference.com/w/cpp/filesystem
Contributions are always welcome!
See list.txt
to get started.
Implement any feature (or fix existing ones) , modify core.cpp
and send a pull request.
- Compile via command: g++ ./core.cpp -I/usr/include/lua5.4 -llua5.4 -fPIC -shared -o fsys.so (or whatever your lua version is)
- file.lua code:
local fsys = require("fsys");
e = fsys.scan("./test_dir");
function scan(e, padding)
for k, v in pairs(e) do
for i = 0 , padding - 1 do
io.write("\t")
end
io.write(v, '\n')
if(fsys.is_dir(v) == true) then
q = fsys.scan(v);
scan(q , padding + 1)
end
end
end
scan(e, 0)