Install
legion pkg install legion-fs
legion-fs
File system utilities for legionhjyu programs.
Install
legion pkg install legion-fs
Usage
summon "legion-fs" release fsforge content <- fs.read("config.json")
fs.write("output.txt", result)
forge files <- fs.list("./src", "*.lhj")
fs.mkdir("build/output")
blade fs.exists("config.json") {
shout("Config found")
}
Functions
| Function | Description |
|---|---|
fs.read(path) | Read file to string |
fs.write(path, content) | Write string to file |
fs.append(path, content) | Append to file |
fs.exists(path) | Check if path exists |
fs.list(dir, glob) | List files matching glob |
fs.mkdir(path) | Create directory (recursive) |
fs.remove(path) | Delete file or directory |
fs.copy(src, dst) | Copy file |
fs.move(src, dst) | Move/rename file |
fs.stat(path) | File metadata |
fs.watch(path, fn) | Watch for changes |