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 }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Here, we use a 3 level relative path and our source clearly exists:
frankfa@palmtree:~/tmp/rename (1) $ nvm use v0.10.12
Now using node v0.10.12
frankfa@palmtree:~/tmp/rename (0) $
frankfa@palmtree:~/tmp/rename (0) $ rm -rf a && mkdir A && node
> var fs=require('fs'); fs.renameSync('A', 'a/b/c');
Error: ENOENT, no such file or directory 'A'
at Object.fs.renameSync (fs.js:543:18)
at repl:1:26
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
If we use a 2 level paths, it also gets quite weird:
> var fs=require('fs'); fs.renameSync('A', 'a/b');
Error: EINVAL, invalid argument 'A'
at Object.fs.renameSync (fs.js:543:18)
at repl:1:26
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
And now for bonus points, 3 levels
> var fs=require('fs'); fs.renameSync('A', 'a/b/c/d');
Error: ENOENT, no such file or directory 'A'
at Object.fs.renameSync (fs.js:543:18)
at repl:1:26
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
If the destination exists, we are good
> var fs=require('fs'); fs.renameSync('A', 'a');
undefined
The text was updated successfully, but these errors were encountered:
Here, we use a 3 level relative path and our source clearly exists:
If we use a 2 level paths, it also gets quite weird:
And now for bonus points, 3 levels
If the destination exists, we are good
The text was updated successfully, but these errors were encountered: