nx_torrent_clean.nx
buildroot/runtime/nx_torrent_clean.nx
about
nx_torrent_clean.nx -- SOVEREIGN disk purge of leftover torrent folders. A folder is DELETED only
if it is NOT in the live torrents.idx (so the operator's real/active downloads are always kept) AND
its control is not "active" (defensive). Reports every action. Frees the dead/removed/duplicate/test
clutter the doctor surfaced. Uses raw unlinkat/rmdir (nx_syscalls has no wrapper). Run: nx_torrent_clean
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
| 6 | const K_MAGIC_2048: i64 = 2048 |
| 7 | const K_MAGIC_65536: i64 = 65536 |
| 8 | const K_MAGIC_1024: i64 = 1024 |
| 10 | const DBUF: i64 = 65536 |
| 11 | const O: *u8 = "/mnt/c/Users/elder/Downloads/nishi-torrents" as *u8 |
| 12 | const IDX: *u8 = "/mnt/c/Users/elder/Downloads/nishi-torrents/torrents.idx" as *u8 |
functions
| 14 | func cl_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func cl_n(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m} var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 16 | func cl_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 17 | func cl_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+cl_len(s) } |
| 19 | func cl_unlink(path: *u8) -> i64 { return __syscall(263, AT_FDCWD, path as i64, 0, 0, 0, 0) } called by 1: cl_rmtree_flat |
| 20 | func cl_rmdir(path: *u8) -> i64 { return __syscall(263, AT_FDCWD, path as i64, 0x200, 0, 0, 0) } called by 1: cl_rmtree_flat |
| 21 | func cl_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 28 | func cl_idx_has(idx: *u8, n: i64, name: *u8, nl: i64) -> i64 called by 1: main |
| 42 | func cl_rmtree_flat(dir: *u8) -> i64 |
| 70 | func main() -> i64 |