Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Strange error behavior
~/dev/node (master)]$ ./node
> process.version
> var fs = require('fs')
// callback for fs.readFile
> var fn = function (err, data) {
if (err) return console.dir(err);
> 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
You can’t perform that action at this time.