Skip to content
Permalink
Browse files

doc: make mkdtemp example work on Windows

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 jasnell committed Sep 14, 2017
1 parent bdfed1a commit acb0d012b303c734c47c5ea9e758132181187703
Showing with 3 additions and 3 deletions.
  1. +3 −3 doc/api/fs.md
@@ -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
});
```

@@ -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) => {

0 comments on commit acb0d01

Please sign in to comment.
You can’t perform that action at this time.