You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.mkdir, fs.mkdtemp(Sync) return ENOENT for the documentation example (Windows, run from git bash) #14960
Update, actually the path translation issue is not so clear, I only get the "C" drive absolute path from mkdir but mkdtemp shows the correct path (still shows the exact same behavior though, both the problem and the workaround):
$ node
> fs.mkdir('/tmp/FOO', err => console.error(err))
undefined
> { Error: ENOENT: no such file or directory, mkdir 'C:\tmp\FOO'
errno: -4058,
code: 'ENOENT',
syscall: 'mkdir',
path: 'C:\\tmp\\FOO' }
> fs.mkdtemp('/tmp/FOO', err => console.error(err))
undefined
> { Error: ENOENT: no such file or directory, mkdtemp '/tmp/FOOXXXXXX'
errno: -4058,
code: 'ENOENT',
syscall: 'mkdtemp',
path: '/tmp/FOOXXXXXX' }
By the way, if I create C:\tmp (outside node) all those commands work:
/tmp/... will be resolved to C:\tmp\... on Windows. If C:\tmp is not present you will get ENOENT, just like with fs.mkdtemp('/nonexisting/...') on Linux.
You should probably use platform specific temp folder, something like:
Activity
lll000111 commentedon Aug 21, 2017
Update, actually the path translation issue is not so clear, I only get the "C" drive absolute path from
mkdirbutmkdtempshows the correct path (still shows the exact same behavior though, both the problem and the workaround):By the way, if I create
C:\tmp(outside node) all those commands work:bzoz commentedon Aug 21, 2017
/tmp/...will be resolved toC:\tmp\...on Windows. IfC:\tmpis not present you will getENOENT, just like withfs.mkdtemp('/nonexisting/...')on Linux.You should probably use platform specific temp folder, something like:
bzoz commentedon Aug 24, 2017
@lll000111 do you still have issue with
mkdtemp?doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows
doc: make mkdtemp example work on Windows