[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: New filesystem module for Lua 5.3 and 5.4 based on C++ std::filesystem
- From: "Jasper Klein" <jasper@...>
- Date: Sun, 29 May 2022 14:19:31 +0200
Hello list,
Recently I've been busy to write a filesystem module for Lua 5.3 and 5.4 based on the C++ std::filesystem library. [1]
The filesystem module supports the same features as std::filesystem does.
This includes the following;
- File operations such as copy, remove and renaming.
- Iterating (recursively) through directories.
- Create and remove symbolic links and hard links.
- Querying permissions and the type of a filesystem entry.
- Modifying permissions.
There is a reference [2] which is based on the cppreference.com filesystem reference that lists all functions and objects.
The filesystem module is not battle tested but I wrote tests to exercise the API.
The module is not pure Lua. So you need to build it and drop the library at a suitable location.
To build the module you must have at least have a C++17 compatible compiler.
I know there is already the LuaFileSystem module. [3]
The reason I started to write this module was to learn about std::filesystem and refreshing my knowledge of the Lua API.
I hope you like it.
-- Jasper
[1] https://github.com/PG1003/filesystem
[2] https://github.com/PG1003/filesystem/blob/main/reference.md
[3] https://keplerproject.github.io/luafilesystem/