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

Should lstatSync return execute bit on directories for Windows? #6381

Closed
juj opened this issue Oct 20, 2013 · 1 comment
Closed

Should lstatSync return execute bit on directories for Windows? #6381

juj opened this issue Oct 20, 2013 · 1 comment

Comments

@juj
Copy link

juj commented Oct 20, 2013

Consider the following code:

var fs = require('fs');
var s = fs.lstatSync('.');
console.log(s.mode);

On Windows, when I save this to a file in a directory in which my current user has full permissions (right-click on the directory -> Properties -> Security -> my username has checkboxes Full Control, Modify, Read & execute, List folder contents, Read and Write), and run it with node.js, I get a return value of 16822, which corresponds to "rw-rw-rw". On linux, if I do the same on a directory that has full 0777 chmod, I get 16895, which is "rwxrwxrwx" as expected.

Shouldn't lstatSync (and its variants) Windows give execute bit on the directory that the current user has full permissions in as well? Or does it have some other special reserved meaning on Windows?

@cookch10
Copy link

+1

Running fs.stat on a directory created with node with the mode parameter set to 0777 returns a mode value of 16822, equivalent to 0666 octal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants