-
-
Notifications
You must be signed in to change notification settings - Fork 35k
Closed
Description
- Version: 12.18.3
- Platform: MacOS (Darwin Kernel Version 19.6.0)
- Subsystem: fs
What steps will reproduce the bug?
- Create a new file:
echo "Hello World" >> test.txt - Run the following snippet:
const fs = require('fs'); fs.copyFileSync('test.txt', 'test.txt');
- Observe output:
cat test.txt
How often does it reproduce? Is there a required condition?
The behavior here appears to be consistent.
What is the expected behavior?
I expect to either receive an error that this action should not be performed, or that the file ends up in the same state as it was initially.
What do you see instead?
The file has been overwritten and is now empty. All data has been lost.
Additional information
This bug could potentially cause data loss in certain situations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels