-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Support of linux files pointed by /dev/fd/XX as the scripts #18255
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
Comments
That's because the module loader canonicalizes paths by resolving all symlinks. I wouldn't qualify this as a bug in node.js. |
Let me notice that the all mentioned paths are links to the existing (temporary) file, and the last example (script |
You misunderstand. Try this in your script: fs.readFileSync(fs.realpathSync(process.argv[2])); // fails with ENOENT |
Well, I see the
Believe me ;-) both those links ( |
Node.js is hardly unique in this:
It's a procfs quirk and since I don't think we'll be encumbering the module loader with fragile file system-specific error detection, I'll go ahead and close this out. Thanks anyway for the bug report. |
You are right - other dev tools seem to have similar troubles. |
Try using this syntax instead:
When you use:
it fails when a piped program closes the read pipe before the previous program is finished writing the whole output, that's why there is a 'no such file or directory' error. Some commands can handle closing a pipe in the middle of the code, some not. |
I like the idea in #23267 (comment) :
|
First I want to say that yes I do agree with the initial observation of not being worth the trouble but... Is this really about supporting "more" of the Linux platform, though? One could say that Linux, or more generally, Unix systems have their own semantics of what files are, and Unix basically says that everything is a file. |
Hello,
it seems files pointed by /dev/fd/XX are not supported by node as scrips:
It is strange because
fs.readFileSync
(mentioned bynode
above) seems to be able to read such files:(
/dev/fd/63
is a link to a file/proc/29648/fd/pipe...
)This issue may be related to the old one: nodejs/node-v0.x-archive#7101
The text was updated successfully, but these errors were encountered: