Skip to content

Instantly share code, notes, and snippets.

@AvianFlu
Created March 23, 2012 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AvianFlu/2175904 to your computer and use it in GitHub Desktop.
Save AvianFlu/2175904 to your computer and use it in GitHub Desktop.
Strange error behavior
~/dev/node (master)]$ ./node
> process.version
'v0.7.7-pre'
> var fs = require('fs')
// callback for fs.readFile
> var fn = function (err, data) {
if (err) return console.dir(err);
console.dir(data);
}
> fs.readFile('/proc/4682/mem', fn);
{ [Error: ESRCH, read] errno: 48, code: 'ESRCH' }
> fs.readFileSync('/proc/4682/mem');
Error: UNKNOWN, unknown error
at Object.readSync (fs.js:316:19)
at Object.readFileSync (fs.js:161:19)
at repl:1:4
at REPLServer.eval (repl.js:89:21)
at repl.js:217:20
at REPLServer.eval (repl.js:96:5)
at Interface.<anonymous> (repl.js:207:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:164:10)
at Interface._line (readline.js:456:8)
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment