code wiki / _hdl_build / nx_mkdirp.nx
nx_mkdirp.nx
buildroot/runtime/_hdl_build/nx_mkdirp.nx
about
nx_mkdirp.nx -- the missing sovereign mkdir-p MCP primitive: create a directory PATH (with parents).
The ecosystem had NO exposed mkdir verb (nx_fs_write cannot create parent dirs) -> knowledge/fetched/
never existed -> the ~119 *_research_fetch organs ALL SAVE-FAIL'd (seq191). This fills that gap.
GUARDED BY CONSTRUCTION (rule 12/26): path MUST start knowledge/ | sites/ | /tmp/ , NO '..' -> writes
confined to safe roots, never OS/system dirs. Idempotent (mkdirat EEXIST ignored). Pattern = the proven
__syscall(258=mkdirat, AT_FDCWD=-100, path, 0755) used across nx_manga_get_gate / nx_evidence_gather.
nx_mkdirp <relpath> -> creates each path component; prints MKDIRP OK <path>
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const MP_MAGIC_1024: i64 = 1024 |
| 12 | const MP_OUT: i64 = 1 |
| 13 | const MP_ERR: i64 = 2 |
functions
| 15 | func mp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 16 | func mp_puts(s: *u8) -> i64 { sys_write(MP_OUT, s, mp_slen(s)); return 0 } |
| 17 | func mp_werr(s: *u8) -> i64 { sys_write(MP_ERR, s, mp_slen(s)); return 0 } |
| 18 | func mp_starts(p: *u8, pre: *u8) -> i64 called by 1: mp_prefix_ok |
| 26 | func mp_has_dotdot(p: *u8) -> i64 called by 1: main |
| 34 | func mp_prefix_ok(p: *u8) -> i64 |
| 43 | func mp_mkdir_one(path: *u8) -> i64 |
| 51 | func mp_exists(path: *u8) -> i64 |
| 58 | func main(argc: i64, argv: *i64) -> i64 |