Skip to content

Commit dc1fa76

Browse files
cjihrigBethGriggs
authored andcommittedApr 4, 2019
doc: add note about mkdtemp() platform differences
PR-URL: #26944 Fixes: #26435 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
1 parent 0d8d842 commit dc1fa76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎doc/api/fs.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,10 @@ changes:
22772277
Creates a unique temporary directory.
22782278

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

22822285
The created folder path is passed as a string to the callback's second
22832286
parameter.
@@ -4280,7 +4283,10 @@ added: v10.0.0
42804283

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

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

0 commit comments

Comments
 (0)