marqdo

Mid stdlib — fs make_dirs, walk, statok

features/16-fs-mid2.mq.md

文档

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 =sizeaccess(`st`, "size")
w = > fs.walk path="m9-demo"
n = > len `w`
> print text=n
> fs.remove_tree path="m9-demo"
Functions
Variables
  • description text
    Recursive dirs, walk, and file metadata (Mid2 M9)
  • markup text
    occlusion
  • n int
    2
  • st map · 4
    size2
    mtime_unix1793515724
    is_fileTrue
    is_dirFalse
  • title text
    Mid stdlib — fs make_dirs, walk, stat
  • w list · 2
    #value
    1readme.txt
    2sub
可执行知识(辅助)

运行与结果

2 2
完整源码
---
markup: occlusion
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](access(`st`, "size"))

**w = > fs.walk path="m9-demo"**
**n = > len `w`**
> print text=`n`

> fs.remove_tree path="m9-demo"

Variable