-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Add the mkdtemp
and mkstemp
methods to fs
#5332
Comments
I have opened a pull request implementing |
/cc @nodejs/ctc ... overall I don't have a problem with this but aren't there userland modules that already cover this? |
@jasnell in fact, I linked a userland version of this, but it does so:
As also pointed out, this function is part of the standard library of many other languages for its utility and because it's easy to mess it up. (See the python page about this.) |
I think it's a worthfile feature to have. As for the API, I'd suggest following Linux's command scheme and only provide a single It's a bit unfortunate that plain cc: @saghul |
I wouldn't oppose adding this to libuv.
|
That's good enough for me! I just want to make sure we're being deliberate
|
@silverwind I don't think we should have
|
@ralt let's say we implement all variants, how many methods are we looking at? |
@silverwind 2. libc provides a couple more, but all the other APIs only provide |
Closing this since |
I would like to propose the addition of
mkdtemp
andmkstemp
to thefs
module, to create a temporary directory and file, respectively.Some manual pages to start with:
So, this utility is fairly often needed for various reasons. Not providing it in nodejs itself means that people try to rewrite it, badly. (Or may I say, inefficiently.) (I'm obviously not trying to put the blame on someone there, except on node.js for not providing the functions ;-).)
This is part of the standard library in most other languages. Whether it's C, python, java, and surely others. I believe node.js would benefit its addition as well.
The text was updated successfully, but these errors were encountered: