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

ensureFileSync vs ensureDirSync #465

Closed
oldrich-s opened this issue Jul 20, 2017 · 1 comment · Fixed by #466
Closed

ensureFileSync vs ensureDirSync #465

oldrich-s opened this issue Jul 20, 2017 · 1 comment · Fixed by #466
Assignees
Labels

Comments

@oldrich-s
Copy link

When ensureDirSync is called on a folder that already exists as a file, EEXIST is thrown as expected.

When ensureFileSync is called on a file that already exists as a folder nothing is thrown.

Should not the two behaviours be the same? IMHO either both should throw or none of them should throw.

@RyanZim
Copy link
Collaborator

RyanZim commented Jul 20, 2017

Yep, confirmed. The issue is that we're just checking if the path exists; we should stat the path and check if it's a file instead.

@RyanZim RyanZim self-assigned this Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants