16-fs-mid2ok
Structure
importfs:lib/fs.mq.md
fn · h1Practical filesystem without plugins
comment
fn · h1main
call
> fs.make_dirs path=m9-demo/subcall
> fs.write_text path=m9-demo/readme.txt text=okbind
`st` = > fs.stat path=m9-demo/readme.txtcall
> print text=[size](`st`)bind
`w` = > fs.walk path=m9-demobind
`n` = > len `w`call
> print text=`n`call
> fs.remove_tree path=m9-demoFunctions
Variables
-
n int22
-
st map · 4
size 2 mtime_unix 1789710476 is_file True is_dir False key value size 2 mtime_unix 1789710476 is_file True is_dir False -
w list · 2
# value 1 readme.txt 2 sub # value 1 readme.txt 2 sub
Execution
2
2
Source
--- title: Mid stdlib — fs make_dirs, walk, stat description: Recursive dirs, walk, and file metadata (Mid2 M9) import fs:lib/fs.mq.md --- # Practical filesystem without plugins `make_dirs` / `remove_tree` / `stat` / `walk` thicken `lib/fs` for scripts and tools. # main > fs.make_dirs path="m9-demo/sub" > fs.write_text path="m9-demo/readme.txt" text="ok" **st = > fs.stat path="m9-demo/readme.txt"** > print text=[size](`st`) **w = > fs.walk path="m9-demo"** **n = > len `w`** > print text=`n` > fs.remove_tree path="m9-demo"
make_dirs/remove_tree/stat/walkthickenlib/fsfor scripts and tools.