-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs.mkdir/mkdirSync hang with {recursive: true} if name is invalid #28599
Comments
Colons on NTFS files systems on Windows denote file streams (source). |
The error is the same for "invalid>", "invalid<" oder "invalid|". |
Yes - I know this module. However, it is not cross plattform as far as I can tell - ':', '<', '>','|' may be valid on Linux (although not necessarily recommended, I guess). Yes, of course I could distinguish platforms. But I could as well rely on "fs.mkdir" to fail, if something is wrong. The point is, Node should, if it fails to create the directory for whatever reason, give a reasonable error and, of course, not hang - with { recursive: true } or not. |
Makes uv_fs_mkdir return UV_EINVAL for invalid filenames instead of UV_ENOENT. Ref: nodejs/node#28599
Makes uv_fs_mkdir return UV_EINVAL for invalid filenames instead of UV_ENOENT. Ref: nodejs/node#28599
This is similar to #27198, which was fixed by #27207. For invalid filenames, Made a libuv PR that makes it return |
Makes uv_fs_mkdir return UV_EINVAL for invalid filenames instead of UV_ENOENT. Ref: nodejs/node#28599 PR-URL: #2375 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Notable changes: - UV_FS_O_FILEMAP has been added for faster access to memory mapped files on Windows. - uv_fs_mkdir() now returns UV_EINVAL for invalid filenames on Windows. It previously returned UV_ENOENT. - The uv_fs_statfs() API has been added. - The uv_os_environ() and uv_os_free_environ() APIs have been added. Fixes: nodejs#28599 Fixes: nodejs#28945 Fixes: nodejs#29008 PR-URL: nodejs#29070 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Notable changes: - UV_FS_O_FILEMAP has been added for faster access to memory mapped files on Windows. - uv_fs_mkdir() now returns UV_EINVAL for invalid filenames on Windows. It previously returned UV_ENOENT. - The uv_fs_statfs() API has been added. - The uv_os_environ() and uv_os_free_environ() APIs have been added. Fixes: #28599 Fixes: #28945 Fixes: #29008 PR-URL: #29070 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Notable changes: - UV_FS_O_FILEMAP has been added for faster access to memory mapped files on Windows. - uv_fs_mkdir() now returns UV_EINVAL for invalid filenames on Windows. It previously returned UV_ENOENT. - The uv_fs_statfs() API has been added. - The uv_os_environ() and uv_os_free_environ() APIs have been added. Fixes: nodejs#28599 Fixes: nodejs#28945 Fixes: nodejs#29008 PR-URL: nodejs#29070 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Notable changes: - UV_FS_O_FILEMAP has been added for faster access to memory mapped files on Windows. - uv_fs_mkdir() now returns UV_EINVAL for invalid filenames on Windows. It previously returned UV_ENOENT. - The uv_fs_statfs() API has been added. - The uv_os_environ() and uv_os_free_environ() APIs have been added. Fixes: #28599 Fixes: #28945 Fixes: #29008 PR-URL: #29070 Backport-PR-URL: #31969 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
If the name of the dir to be created is invalid, fs.mkdir never calls back and fs.mkdirSync blocks:
BTW, the error message that is reported with {recursive: false} appears a bit strange:
Wouldn't it be more convenient to use EPERM, EACCES or ENOTDIR?
The text was updated successfully, but these errors were encountered: