-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In "fs.copyFile(src, dest[, mode], callback)" , for callback,'err' is not defined. #53230
Comments
import { copyFile, constants } from 'node:fs';
function callback(err) {
if (err) throw err;
console.log('source.txt was copied to destination.txt');
}
// destination.txt will be created or overwritten by default.
copyFile('source.txt', 'destination.txt', callback);
// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); The documentation mentions an |
From my test,
|
I ran the same code and got the same result, this seems like a doc-only issue. @Vikranthraosb is that was you were referring to? |
yes. it's an doc-only issue. |
If it's not an doc-only issue, could you please clarify what exactly the issue is? |
Fixed by #53234 |
Affected URL(s)
https://nodejs.org/docs/latest/api/fs.html#fscopyfilesrc-dest-mode-callback
Description of the problem
There should be an "err" in the callback function for copyFile model, which is absent. Please do add it..
The text was updated successfully, but these errors were encountered: