code wiki / (root) / nx_fs.nx

nx_fs.nx

buildroot/runtime/nx_fs.nx

4329 B69 linesdepth 2pulls 2 transitivereach 6 importersview sourcekind tooltopic fs
docsdependenciesstructsconstsfunctions

about

nx_fs.nx -- SOVEREIGN file-ops multitool: the bottom-rung NISHI replacement for the GNU coreutils (cp/mv/rm/ls/cat/mkdir) so EVERY layer is nishi -- we stop leaning on non-nishi tooling. Own syscalls only (sys_openat/read/write/renameat/unlink/mkdir + getdents64; no busybox, no coreutils). As we do work we reach for THIS, and the ecosystem gains the capability (s-class exceed from the bottom up). usage: nx_fs cp <src> <dst> | mv <src> <dst> | rm <path> | mkdir <path> | ls <dir> | cat <path> exit 0 ok, non-zero on failure license_tier: ORIGINAL

dependencies 1 imports · 6 importers

nx_syscalls.nx nx_fs.nx fs_result_test.nx fs_unlink_tail_test.nx nx_fs_gate.nx nx_nxmake.nx nx_race_telemetry.nx nx_tsv.nx

imports: nx_syscalls.nx

imported by: fs_result_test.nxfs_unlink_tail_test.nxnx_fs_gate.nxnx_nxmake.nxnx_race_telemetry.nxnx_tsv.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main fs_w sys_write fs_streq fs_cp sys_openat_rd sys_openat_wr sys_close sys_mmap sys_read sys_write ↻ fs_mv sys_renameat fs_cp ↻ fs_rm fs_rm ↻ fs_mkdir sys_mkdir fs_ls sys_mmap ↻ fs_w ↻ sys_close ↻ fs_cat sys_openat_rd ↻ sys_mmap ↻ sys_read ↻ sys_write ↻ sys_close ↻

structs

none

consts

9const K_MAGIC_65536: i64 = 65536

functions

11func fs_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: fs_lsmain calls 1: sys_write
12func fs_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 }
called by 1: main
15func fs_cp(src: *u8, dst: *u8) -> i64
22func fs_rm(path: *u8) -> i64 { return __syscall(263, 0-100, path, 0, 0, 0, 0) } // unlinkat(AT_FDCWD, path, 0)
called by 3: fs_mvmainmain
24func fs_mv(src: *u8, dst: *u8) -> i64
called by 2: mainmain calls 3: sys_renameatfs_cpfs_rm
29func fs_mkdir(path: *u8) -> i64 { return sys_mkdir(path, 0x1ff) }
called by 2: mainmain calls 1: sys_mkdir
30func fs_cat(path: *u8) -> i64
36func fs_ls(dir: *u8) -> i64
called by 1: main calls 3: sys_mmapfs_wsys_close
59func main(argc: i64, argv: *i64) -> i64