Skip to content

Commit d76c30c

Browse files
cjihrigBethGriggs
authored andcommitted
doc: add note about mkdtemp() platform differences
PR-URL: #26944 Fixes: #26435 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent 4a7a84a commit d76c30c

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
@@ -2274,7 +2274,10 @@ changes:
22742274
Creates a unique temporary directory.
22752275

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

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

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

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

0 commit comments

Comments
 (0)