-
Notifications
You must be signed in to change notification settings - Fork 773
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
.ensureDir(..) fails silently when passed an invalid path... #237
Comments
…ardson/node-fs-extra#237)... Signed-off-by: Alex A. Naanou <[email protected]>
Suggestions on a clean fix? My initial plan would be to just test for invalid characters in the path... |
@jprichardson I did not dive into the implementation, but in general I think it's obvious, pass an error to the callback in the same manner as native node
UPDATE: Another solution would be to syntax-check the path before creating anything, this way one would avoid leaks and managing stray directories, but here we'll have to implement/use OS-specific check, plus there are things that can't be checked easily before actually touching the file system, like access rights/ACLs, so the first approach still seems preferable (IMHO). |
This is oversimplifying the problem ;) I'll come up with something. |
Appears to be working fine now, thanks!! |
To reproduce:
fs.ensureDir('l:/tmp/foo:moo', err => console.log('>>>', err) )
Expected:
A error is generated and passed to the callback.
Result:
NOTE: for now tested only on windows.
The text was updated successfully, but these errors were encountered: