Skip to content

Commit

Permalink
doc: add note about mkdtemp() platform differences
Browse files Browse the repository at this point in the history
PR-URL: #26944
Fixes: #26435
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
  • Loading branch information
cjihrig authored and BethGriggs committed Apr 8, 2019
1 parent 4a7a84a commit d76c30c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,10 @@ changes:
Creates a unique temporary directory.

Generates six random characters to be appended behind a required
`prefix` to create a unique temporary directory.
`prefix` to create a unique temporary directory. Due to platform
inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
notably the BSDs, can return more than six random characters, and replace
trailing `X` characters in `prefix` with random characters.

The created folder path is passed as a string to the callback's second
parameter.
Expand Down Expand Up @@ -4267,7 +4270,10 @@ added: v10.0.0

Creates a unique temporary directory and resolves the `Promise` with the created
folder path. A unique directory name is generated by appending six random
characters to the end of the provided `prefix`.
characters to the end of the provided `prefix`. Due to platform
inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
notably the BSDs, can return more than six random characters, and replace
trailing `X` characters in `prefix` with random characters.

The optional `options` argument can be a string specifying an encoding, or an
object with an `encoding` property specifying the character encoding to use.
Expand Down

0 comments on commit d76c30c

Please sign in to comment.