Skip to content

Commit

Permalink
doc: make mkdtemp example work on Windows
Browse files Browse the repository at this point in the history
PR-URL: #15408
Fixes: #14960
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
bzoz authored and MylesBorins committed Oct 25, 2017
1 parent 0b5798b commit ab014d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,10 +1133,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
});
```

Expand All @@ -1148,7 +1148,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

0 comments on commit ab014d4

Please sign in to comment.