jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.47k stars 772 forks source link

fs.copy throw unexplained error ENOENT, utime #40

Closed nirmelamoud closed 10 years ago

nirmelamoud commented 10 years ago

Hi

trying to copy a file from path a to another path 50% of the time, I get the following error Error: ENOENT, utime 'my target path' this happen right after I call fs.copy(oldPath, targetpath, function (error) { - -it get to the block with the above error - any idea ?

the file exist in the old path, but the strange thing is that it is also appeared on the target path , so the copy worked ???

what is the above error ? (what is the utime part of it) ?

I think it happens when fs.copy try to set the timestamp of the file after copying it, when I wrap it with try catch it never happened again - but the problem is that its not consistent it happen only in 50% of the times.

thanks

jprichardson commented 10 years ago

That's really weird. Would you

npm install fs-extra@0.6.4

and see if you still have the same problem?

Thanks!

slonoed commented 10 years ago

Trying fs-extra@0.6.4 on 0.10.25 node. Same problem.

jprichardson commented 10 years ago

Can you provide an example to help me reproduce the problem? Thanks.

slonoed commented 10 years ago

Oh, sorry. Same message, but my problem not in fs-extra.

jprichardson commented 10 years ago

Need more information.

imaia commented 8 years ago

I have the same problem. If I remove the file before coping, it works. This only happens if destiny already exists.

AndyOGo commented 7 years ago

same random ENOENT errors here, though the path is correct. Really weird. Happened as I switched from sync to async APIs.

RyanZim commented 7 years ago

@AndyOGo Please open a new issue, preferably with a reduced test case. Thanks!