Duplicate of issue #71 and others. Existing fixes in PRs #77, #88, and others.
A new fix and test are proposed in PR #94.
Duplicate copies: when clobbering an existing file, onFile does both a remove-and-copy (line 94) and possibly copies the file again depending on modified (line 102).
Early callback: both the call to copyFile on line 95 and one of the later calls to copyFile or cb will increment the number of finished callbacks, with the result that the callback passed to ncp is called too early, before the copy is necessarily completed.
Duplicate of issue #71 and others. Existing fixes in PRs #77, #88, and others.
A new fix and test are proposed in PR #94.
Duplicate copies: when clobbering an existing file,
onFile
does both a remove-and-copy (line 94) and possibly copies the file again depending onmodified
(line 102).Early callback: both the call to
copyFile
on line 95 and one of the later calls tocopyFile
orcb
will increment the number of finished callbacks, with the result that the callback passed toncp
is called too early, before the copy is necessarily completed.