Skip to content

Improve the fs module, add new methods/functions (mkfifo, mknod) #38344

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

Closed
mStirner opened this issue Apr 22, 2021 · 12 comments
Closed

Improve the fs module, add new methods/functions (mkfifo, mknod) #38344

mStirner opened this issue Apr 22, 2021 · 12 comments
Labels
feature request Issues that request new features to be added to Node.js. fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. stale

Comments

@mStirner
Copy link

Is your feature request related to a problem? Please describe.
No. Improve the fs module, without the need to spawn child process for basic operations. (Like crate a named fifo pipe)

Add to the fs module methods:

@aduh95
Copy link
Contributor

aduh95 commented Apr 22, 2021

A few questions:

  • Could this operations be implemented by a userland module/package?
  • it seems this are not POSIX operations, are they? If so, how would that work on non-Linux systems?
  • Node.js uses libuv to send the fs operations to the OS, this feature request would probably need to be sent upstream. Are you willing to send a PR their way to implement these features?

@mStirner
Copy link
Author

Im not sure if i understand you correctly, but there are methods/operations:
https://man7.org/linux/man-pages/man3/mkfifo.3.html, https://man7.org/linux/man-pages/man2/mknod.2.html

Can you clarify (give me a example) what are a "POSIX operation" is?

how would that work on non-Linux systems

Indeed, this would only work for Unix/Linux/*nix based OSs.
Not sure if Windows has this kind of stuff.

@kuzmaMinin

This comment has been minimized.

@aduh95
Copy link
Contributor

aduh95 commented Apr 22, 2021

Can you clarify (give me a example) what are a "POSIX operation" is?

POSIX is a family of standards that most OSes follow (GNU/Linux, Unix and Unix-like), the neat thing about POSIX is you can use the same implementation everywhere and expect it to work (well we'd still need to make a Windows-specific implementation I guess). If those operations are not defined by a POSIX standard, I'm not sure it's reasonable for us to make a cross-platform API given the number of platforms Node.js supports.
I'm not sure "POSIX operation" is the right terminology. An example of one would be https://man7.org/linux/man-pages/man3/mq_open.3.html, it has a section stating CONFORMING TO POSIX.1-2001, POSIX.1-2008.

@mStirner
Copy link
Author

mStirner commented Apr 22, 2021

I was confused by the term "operation".
Looks like there is a "operation" for mkfifio: https://man7.org/linux/man-pages/man3/mkfifo.3.html#CONFORMING_TO & mknod: https://man7.org/linux/man-pages/man2/mknod.2.html#CONFORMING_TO

Windows has also "named pipes": https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes
Perhaps a work around is needed for "fifo" pipes: https://stackoverflow.com/a/47248242/5781499

In python (https://docs.python.org/3/library/os.html#os.mkfifo, see "Availability"), if you use the "os" module, its common that some methods are not exists if you switch to/from windows/linux.
Why not "ignore" windows, and only support *nix operating systems?

@aduh95 aduh95 added feature request Issues that request new features to be added to Node.js. fs Issues and PRs related to the fs subsystem / file system. labels Apr 22, 2021
@aduh95
Copy link
Contributor

aduh95 commented Apr 22, 2021

We already have macOS specific fs operations for some reason (E.G.: https://nodejs.org/api/fs.html#fs_fspromises_lchmod_path_mode), so yeah, it's worth considering integrating it without Windows support as a first step. Since those are indeed POSIX features (sorry I read the wrong man page at first), we might be able to implement it in a cross-platform way. Leaving Windows support aside, would you be interested on working on an implementation?

@mStirner
Copy link
Author

Interested, of course. But i dont think im not the right person for this.
No clue where to start and i cant code in c/c++.

@jasnell
Copy link
Member

jasnell commented Apr 22, 2021

Generally speaking we tend to rely on abstracted implementations of file system functions provided by the libuv dependency. For any new fs functions the discussion should start there (https://github.com/libuv/libuv)

@aduh95
Copy link
Contributor

aduh95 commented Apr 22, 2021

To help your feature request finding volunteers, I recommend create two separate issues on the libuv repo: one for mkfifo and one for mknod.

@jasnell jasnell added the libuv Issues and PRs related to the libuv dependency or the uv binding. label May 12, 2021
@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Mar 24, 2022
@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions
Copy link
Contributor

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. stale
Projects
None yet
Development

No branches or pull requests

4 participants