Title: stat.isFIFO() is wrongly marked as always false on Windows, even when piping into a node process · Issue #57603 · nodejs/node · GitHub
Open Graph Title: stat.isFIFO() is wrongly marked as always false on Windows, even when piping into a node process · Issue #57603 · nodejs/node
X Title: stat.isFIFO() is wrongly marked as always false on Windows, even when piping into a node process · Issue #57603 · nodejs/node
Description: Version v22.14.0 Platform Microsoft Windows NT 10.0.26120.0 x64 [although this is on ARM64] Subsystem No response What steps will reproduce the bug? Running echo '{}' | node -e 'console.log(require("fs").fstatSync(0).mode)' in PowerShell...
Open Graph Description: Version v22.14.0 Platform Microsoft Windows NT 10.0.26120.0 x64 [although this is on ARM64] Subsystem No response What steps will reproduce the bug? Running echo '{}' | node -e 'console.log(require...
X Description: Version v22.14.0 Platform Microsoft Windows NT 10.0.26120.0 x64 [although this is on ARM64] Subsystem No response What steps will reproduce the bug? Running echo '{}' | node -e 'console...
Opengraph URL: https://github.com/nodejs/node/issues/57603
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stat.isFIFO() is wrongly marked as always false on Windows, even when piping into a node process","articleBody":"### Version\n\nv22.14.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.26120.0 x64 [although this is on ARM64]\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nRunning `echo '{}' | node -e 'console.log(require(\"fs\").fstatSync(0).mode)'` in PowerShell (as cmd doesn't seem to support pipes via the usual syntax) returns 4096, and checking `fs.constants`, `S_IFIFO` is set to `4096`. \n\n### How often does it reproduce? Is there a required condition?\n\nSeems to be all the time on Windows when you try to pipe something in, which is due to a (I assume legacy?) check here: https://github.com/nodejs/node/blob/c3b6f949748b49ef25b0239bd4582d29976fdbad/lib/internal/fs/utils.js#L538-L541\n\n### What is the expected behavior? Why is that the expected behavior?\n\nOn Windows, `stat.isFIFO()` should correctly handle pipes and `stat.isFIFO()` should correctly return `true` when piped in\n\n### What do you see instead?\n\n`stat.isFIFO()` always returns false on Windows, even if the mode has the flag set\n\n### Additional information\n\nI would love to submit a PR to fix this, but I am not sure if those checks are there for a reason or for legacy purposes (it seems that at least the S_ISFIFO is now exposed but it wasn't before [?]), and if it can be edited safely. ","author":{"url":"https://github.com/vladfrangu","@type":"Person","name":"vladfrangu"},"datePublished":"2025-03-24T09:13:32Z","url":"https://github.com/nodejs/node/issues/57603"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7378a375-6c45-1f3a-9eaf-e86b4098047e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEEC:1E80BA:3F6EC9:55C84E:6B061F19 |
| html-safe-nonce | 2e7b3ce2329578904ed65e3436db1dd300692c94915a89e6e90b1d223ae9d2ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUVDOjFFODBCQTozRjZFQzk6NTVDODRFOjZCMDYxRjE5IiwidmlzaXRvcl9pZCI6IjcyNjIyMzk0MDEzMzE5OTY0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 060b5cdb4833d583590fdc347e557c873a1a36584aea420c60325d4aa5dbc25b |
| hovercard-subject-tag | issue:2942545233 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/57603/issue_layout |
| twitter:image | https://opengraph.githubassets.com/213070eafff92d4dac7830d4aa1f0f875ba67dbf177949369b2955604b0ad056/nodejs/node/issues/57603 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/213070eafff92d4dac7830d4aa1f0f875ba67dbf177949369b2955604b0ad056/nodejs/node/issues/57603 |
| og:image:alt | Version v22.14.0 Platform Microsoft Windows NT 10.0.26120.0 x64 [although this is on ARM64] Subsystem No response What steps will reproduce the bug? Running echo '{}' | node -e 'console.log(require... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vladfrangu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9a7c5824b75ea2ec5e3de73a483229c7bb9f32a774ffd401f010dd9bacf1483d |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b25c3080e84402f75431d8dc7a96b2635219cec7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width