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

mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows #119

Closed
jacob-adams opened this issue Mar 20, 2015 · 2 comments
Milestone

Comments

@jacob-adams
Copy link

The following code will never call the provided callback when executed on a windows machine:

fs.ensureDir('C:\\temp\\a?b', function(err){console.log(err)})

It also makes the node process consume a lot of CPU indefinitely. For reference, the built-in node function 'fs.mkdir' calls the callback with an error if it is called with a path that has invalid characters. The following is an example of the error reported by node's fs.mkdir function:

> fs.mkdir('C:\\temp\\a?b', function(err){console.log(err)})
> { [Error: ENOENT, mkdir 'C:\temp\a?b'] errno: -4058, code: 'ENOENT', path: 'C:\\temp\\a?b' }

It appears that the problem occurs because calling mkdir throws the same error for a path with invalid characters as it does for a path with a parent directory that does not exist.

@jprichardson
Copy link
Owner

Thanks for the report! I'm going to have to get fs-extra setup on AppVeyor to be able to test these Windows specific bugs...

@jprichardson jprichardson modified the milestone: 1.0 Jul 2, 2015
@jprichardson
Copy link
Owner

Related #209, #237. Fixed.

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

No branches or pull requests

2 participants