db&w documentation wiki

finest software | finest docs

User Tools

Site Tools


vai:lua_fs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vai:lua_fs [2026/09/14 15:39] lightwolfvai:lua_fs [2026/09/16 14:34] (current) lightwolf
Line 1: Line 1:
-====== lua_fs ======+====== lua_fs - std::filesystem for Lua ======
  
 `lua_fs` is a Lua loadable shared library that exposes the C++17 `std::filesystem` library through [sol2](https://github.com/ThePhD/sol2). Paths can be passed as ordinary Lua strings or as `fs.path` objects. Filesystem failures raise a Lua error containing the operating-system error message. `lua_fs` is a Lua loadable shared library that exposes the C++17 `std::filesystem` library through [sol2](https://github.com/ThePhD/sol2). Paths can be passed as ordinary Lua strings or as `fs.path` objects. Filesystem failures raise a Lua error containing the operating-system error message.
Line 61: Line 61:
 | `fs.set_current_path(path)` | Changes the process working directory. Returns no value. | `fs.set_current_path("work")` | | `fs.set_current_path(path)` | Changes the process working directory. Returns no value. | `fs.set_current_path("work")` |
 | `fs.temp_directory_path()` | Returns the operating system temporary directory. | `local temp = fs.temp_directory_path()` | | `fs.temp_directory_path()` | Returns the operating system temporary directory. | `local temp = fs.temp_directory_path()` |
-| `fs.directory(path)` | Returns a 1-based Lua array of immediate child paths. | `for _, p in ipairs(fs.directory("data")) do print(p) end+| `fs.directory(path)` | Returns a 1-based Lua array of immediate child paths. | <code lua>for _, p in ipairs(fs.directory("data")) do 
-| `fs.recursive_directory(path)` | Returns a 1-based Lua array containing all descendants recursively. | `for _, p in ipairs(fs.recursive_directory("data")) do print(p) end|+   print(p) 
 +end</code> 
 +| `fs.recursive_directory(path)` | Returns a 1-based Lua array containing all descendants recursively. | <code lua>for _, p in ipairs(fs.recursive_directory("data")) do 
 +   print(p) 
 +end</code> |
  
 ==== Queries and metadata ==== ==== Queries and metadata ====
vai/lua_fs.1789393199.txt.gz · Last modified: by lightwolf