-
Notifications
You must be signed in to change notification settings - Fork 779
Closed
Labels
Milestone
Description
I hope this module can be as clever as cp. It should recognize copying between identical files and do nothing.
Now, v0.26.2, neither copy nor copySync can handle these cases correctly.
- If
srcanddstare the same file- It opens a read stream first, and then a write stream, which results in the file becomes empty.
- If
srcis symbolic link and points todst- By default, option
clobberistrue, so thatdstwill be removed, which means the real file is removed. Ifclobberisfalse, the file becomes empty.
- By default, option
- If
dstis symbolic link and points tosrc- Similar to the previous case,
dstis removed and a new file is created, then the link is not existed any more. Or the file becomes empty.
- Similar to the previous case,
I have added corresponding test cases in my branch.