nx_fs.nx
buildroot/runtime/nx_fs.nx
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
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
structs
| none |
consts
| 9 | const K_MAGIC_65536: i64 = 65536 |
functions
| 11 | func 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 } |
| 12 | func 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 |
| 15 | func fs_cp(src: *u8, dst: *u8) -> i64 |
| 22 | func fs_rm(path: *u8) -> i64 { return __syscall(263, 0-100, path, 0, 0, 0, 0) } // unlinkat(AT_FDCWD, path, 0) |
| 24 | func fs_mv(src: *u8, dst: *u8) -> i64 |
| 29 | func fs_mkdir(path: *u8) -> i64 { return sys_mkdir(path, 0x1ff) } |
| 30 | func fs_cat(path: *u8) -> i64 |
| 36 | func fs_ls(dir: *u8) -> i64 |
| 59 | func main(argc: i64, argv: *i64) -> i64 |