Skip to content
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

copySync empty folder into an existing file #464

Closed
oldrich-s opened this issue Jul 20, 2017 · 4 comments
Closed

copySync empty folder into an existing file #464

oldrich-s opened this issue Jul 20, 2017 · 4 comments

Comments

@oldrich-s
Copy link

Copy an empty folder into an existing file. I would expect, an error should be thrown as the file cannot be overwritten by a folder. Since the folder is empty, no error is thrown and no folder is created. If the folder is not empty, ENOENT is thrown.

@RyanZim
Copy link
Collaborator

RyanZim commented Jul 20, 2017

This behavior is consistent in both copy & copySync. The behavior does seem a little weird, though. To be honest, this is what I hate about copy; there are a million edge cases + always one more that you haven't thought of.

CC @jprichardson @manidlou for thoughts here; so far I haven't pinned down why it's doing this.

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 18, 2017

@jprichardson @manidlou ping?

@manidlou
Copy link
Collaborator

Yeah I also confirm the faulty behavior! However, I applied a possible fix for this issue in #502 that prevents this from happening. When rewriting copy is finished, then related changes will be applied to copySync as well since they need to be consistent.

@manidlou
Copy link
Collaborator

Fixed in 5.0.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants