mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
copyFileSync/copyFile took exactly two arguments; the third is libuv's copyfile flag bits (COPYFILE_EXCL 1, COPYFILE_FICLONE 2, FICLONE_FORCE 4 — fs.constants.* reads bake to literals). The surface row now carries the F64, and both forms lower to new flag-aware runtime entries that reuse the existing recursive-copy helper (reflink via ioctl, EXCL through open) after Node's own range check: a mode outside [0, 7] throws the RangeError "mode is out of range: >= 0 && <= 7". writeFileSync/writeFile fenced every `flag` option although "w" (the default truncate-or-create) and "wx" (O_EXCL: EEXIST when the path exists) write the bytes the lowered path already writes. Both literal flags now lower; every other flag still fences by name because it writes different bytes. The exclusive form is a separate runtime entry so the open flags stay compile-time known. Corpus 8427 pins the sync and promise forms of both against Node, including the EEXIST and range errors, the mode-plus-flag combination and the async twins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>