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

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

Closed
geoffreak opened this issue Oct 24, 2011 · 1 comment
Closed

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

geoffreak opened this issue Oct 24, 2011 · 1 comment
Labels

Comments

@geoffreak
Copy link

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?

@koichik
Copy link

koichik commented Oct 24, 2011

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.

@koichik koichik closed this as completed Oct 24, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants