Closed
Description
During test-writing / manual fuzzing, I noticed that the doc for mkdtemp added in #6800 states that "Generates six random characters to be appended behind a required prefix to create a unique temporary directory". This is true on Linux and Windows, but misses an edge case on BSDs (including Apple). As seen below, it actually "replaces trailing X's with random characters and then appends six additional random characters to the prefix to create a unique directory name".
// on macOS
> fs.mkdtempSync(path.join(os.tmpdir(), 'foox')) // does as documented
'/tmp/fooxz5Ve7r'
> fs.mkdtempSync(path.join(os.tmpdir(), 'fooX')) // also replaces the X from the prefix
'/tmp/foo1PqEasA'
^-- not an 'X'
I think this is just a doc issue, but opening this as an issue to hear what others think.
Activity