vai:lua_fs
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| vai:lua_fs [2026/09/14 15:38] – created lightwolf | vai:lua_fs [2026/09/16 14:34] (current) – lightwolf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== lua_fs ====== | + | ====== lua_fs |
| `lua_fs` is a Lua loadable shared library that exposes the C++17 `std:: | `lua_fs` is a Lua loadable shared library that exposes the C++17 `std:: | ||
| Line 14: | Line 14: | ||
| Paths may be Lua strings or `fs.path` objects. A function that encounters an operating-system error raises a Lua error. Boolean query functions return `false` for a missing path unless the underlying operation itself fails. | Paths may be Lua strings or `fs.path` objects. A function that encounters an operating-system error raises a Lua error. Boolean query functions return `false` for a missing path unless the underlying operation itself fails. | ||
| - | ===== `fs.path` ===== | + | ===== fs.path ===== |
| '' | '' | ||
| Line 61: | Line 61: | ||
| | `fs.set_current_path(path)` | Changes the process working directory. Returns no value. | `fs.set_current_path(" | | `fs.set_current_path(path)` | Changes the process working directory. Returns no value. | `fs.set_current_path(" | ||
| | `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(" | + | | `fs.directory(path)` | Returns a 1-based Lua array of immediate child paths. | <code lua>for _, p in ipairs(fs.directory(" |
| - | | `fs.recursive_directory(path)` | Returns a 1-based Lua array containing all descendants recursively. | `for _, p in ipairs(fs.recursive_directory(" | + | print(p) |
| + | end</ | ||
| + | | `fs.recursive_directory(path)` | Returns a 1-based Lua array containing all descendants recursively. | <code lua>for _, p in ipairs(fs.recursive_directory(" | ||
| + | print(p) | ||
| + | end</ | ||
| ==== Queries and metadata ==== | ==== Queries and metadata ==== | ||
vai/lua_fs.1789393118.txt.gz · Last modified: by lightwolf
