-
Notifications
You must be signed in to change notification settings - Fork 30.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.fstat(0) fails on Windows #40006
Comments
It can be easily reproduced with the following script: require('fs').fstatSync(0) |
@nodejs/platform-windows This is still an issue on my machine. |
StefanStojanovic
added a commit
to JaneaSystems/libuv
that referenced
this issue
Aug 18, 2022
Calling uv_fs_fstat for stdin, stdout or stderr was resulting in error on Windows while it was retrieving data on Linux. This change enables uv_fs_fstat to work on Windows for stdio streams too. A simple test is also added to check this behavior on all platforms. It fixes nodejs/node#40006
StefanStojanovic
added a commit
to JaneaSystems/libuv
that referenced
this issue
Aug 25, 2022
Calling uv_fs_fstat for stdin, stdout or stderr was resulting in error on Windows while it was retrieving data on Linux. This change enables uv_fs_fstat to work on Windows for stdio streams too. A simple test is also added to check this behavior on all platforms. Refs: nodejs/node#40006
vtjnash
added a commit
to libuv/libuv
that referenced
this issue
Nov 29, 2022
Calling uv_fs_fstat for file types other then disk type was resulting in error on Windows while it was retrieving data on Linux. This change enables getting fstat for pipes and character files on Windows with data fetched being as reasonable as possible. A simple test is also added to check this behavior on all platforms. It uses stdin, stdout and stderr. uv_fs_fstat needs to pass with disk files pipes and character files (eg. console). Refs: nodejs/node#40006 Co-authored-by: Jameson Nash <vtjnash@gmail.com>
The fix for this landed in libuv libuv/libuv#3811. The next time libuv is updated Node will be fixed as well. |
After updating |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
master,v16.8.0
Platform
Microsoft Windows NT 10.0.22000.0 x64 (latest Windows 11 beta)
Subsystem
fs
What steps will reproduce the bug?
Run
node test/parallel/test-fs-stat.js
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
Test should pass
What do you see instead?
node test/parallel/test-fs-stat.js
node:assert:986
throw newErr;
^
Additional information
Fails here:
node/test/parallel/test-fs-stat.js
Line 50 in 80785f6
The text was updated successfully, but these errors were encountered: