Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Strange fs.stat error results (Windows 0.5.10) #1927

Closed
geoffreak opened this Issue · 1 comment

2 participants

Joshua DeVinney Koichi Kobayashi
Joshua DeVinney

The following code produces vary different results on both Windows (0.5.10) and Mac (0.4.12) when run on an non-existent directory:

util = require('util');
require('fs').stat('/directory/does/not/exist', function(err, stat){
    console.log(util.inspect(err));
    console.log(util.inspect(stat));
});

Mac (0.4.12) - expected results

{ stack: [Getter/Setter],
  arguments: undefined,
  type: undefined,
  message: 'ENOENT, No such file or directory \'/directory/does/not/exist\'',
  errno: 2,
  code: 'ENOENT',
  path: '/directory/does/not/exist' }
undefined

Windows (0.5.10) - unexpected results

{ [ Error: ENOENT, The operation completed successfully.
 '/directory/does/not/exist'] errno: 32, code: 'ENOENT', path: '/directory/does/not/exist' }
undefined

I don't currently have 0.5.10 installed on my Mac to confirm the results there.

Surely the 0.5.10 results are a bug?

Koichi Kobayashi
Owner

Because all properties of an Error are non-enumerable since Node v0.5.1 (v8 3.4), the format of an Error has changed.
See also #1634.

Koichi Kobayashi koichik closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.