Node-SMB / marsaud-smb2

SMB2 Client
53 stars 46 forks source link

isDirectory not working #68

Closed nerminator closed 3 years ago

nerminator commented 3 years ago

when we call readdir with options : {stats:true}, calling isDirectory for a file in files array is always returning false.

The problem is in tools/stats.js: line 17: return attr === DIRECTORY; should be : (attr & DIRECTORY) == DIRECTORY

julien-f commented 3 years ago

Thanks for your report, a PR would be most welcome :slightly_smiling_face:

vdiez commented 3 years ago

you're right, it's a mask.

Didn't think of it, as my server did not return other values aside of 16. If you can, as @julien-f said please provide PR. Otherwise I will next week