Skip to content

doc: clarify fs.copyFile() error handling#63544

Open
bobu-putheeckal wants to merge 1 commit into
nodejs:mainfrom
bobu-putheeckal:codex-doc-52916
Open

doc: clarify fs.copyFile() error handling#63544
bobu-putheeckal wants to merge 1 commit into
nodejs:mainfrom
bobu-putheeckal:codex-doc-52916

Conversation

@bobu-putheeckal
Copy link
Copy Markdown

@bobu-putheeckal bobu-putheeckal commented May 24, 2026

Fixes: #52916

This clarifies how fsPromises.copyFile(), fs.copyFile(), and fs.copyFileSync() surface errors and points readers to Common System Errors for code values.

Evidence checked:

  • fsPromises.copyFile() calls binding.copyFile(..., kUsePromises) in lib/internal/fs/promises.js.
  • fs.copyFile() and fs.copyFileSync() both route through binding.copyFile() in lib/fs.js.
  • The binding maps to libuv uv_fs_copyfile in src/node_file.cc, so failures surface as the usual file-system errors for the promise, callback, and sync APIs respectively.

Validation:

  • git diff --check
  • node tools/lint-md/lint-md.mjs doc/api/fs.md
  • npx -q core-validate-commit --no-validate-metadata --tap HEAD

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels May 24, 2026
Fixes: nodejs#52916
Signed-off-by: Bob Put <bobu.work@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC] : Error Handling Missing in fs.copyFile() Documentation

2 participants