Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Wrong EEXIST error message for fs.symlinkSync #8651

Closed
joliss opened this issue Oct 30, 2014 · 1 comment
Closed

Wrong EEXIST error message for fs.symlinkSync #8651

joliss opened this issue Oct 30, 2014 · 1 comment

Comments

@joliss
Copy link

joliss commented Oct 30, 2014

Similar to #6510 (cc @indutny), the error message for fs.symlinkSync (and fs.symlink, perhaps) is mixed up:

$ touch a b; node -e "var fs = require('fs'); fs.symlinkSync('a', 'b')"

fs.js:741
  return binding.symlink(preprocessSymlinkDestination(destination, type),
                 ^
Error: EEXIST, file already exists 'a'
    at Object.fs.symlinkSync (fs.js:741:18)
    at [eval]:1:28
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:536:25)
    at startup (node.js:80:7)
    at node.js:906:3

I think it should be: Error: EEXIST, file already exists 'b'

I'm using Node v0.10.33.

chrisdickinson pushed a commit that referenced this issue Nov 16, 2014
the arguments were swapped, so fs.symlink{Sync,} would
report that the wrong file EEXIST'd in error.

Fixes: #8651
Fixes: #4314
Fixes: #5381
PR-URL: #8657
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
@chrisdickinson
Copy link

Fixed for v0.12 by f6556b6. Thanks for the report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants