Skip to content
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

doc: make mkdtemp example work on Windows #15408

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1536,10 +1536,10 @@ object with an `encoding` property specifying the character encoding to use.
Example:

```js
fs.mkdtemp('/tmp/foo-', (err, folder) => {
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
if (err) throw err;
console.log(folder);
// Prints: /tmp/foo-itXde2
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is also incorrect for macOS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be blocking though, right? As a comment it should be fine as is? (I do not have a Mac to test this on my own)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm the tmp dir is different on macOS but ofc this comment should not block PR from landing.

});
```

Expand All @@ -1551,7 +1551,7 @@ the `prefix` *must* end with a trailing platform-specific path separator

```js
// The parent directory for the new temporary directory
const tmpDir = '/tmp';
const tmpDir = os.tmpdir();

// This method is *INCORRECT*:
fs.mkdtemp(tmpDir, (err, folder) => {
Expand Down