-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.lstatSync() isn't instance of fs.Stats on Node.js 0.12 #35
Comments
It's still occurs with @isaacs Could you take a look? 😢 |
This also seems to effect the When graceful-fs is require'd, the Stats constructor is rebound in native code (https://github.com/joyent/node/blob/e9ce8fc82a6d12e790511b62852e820d8be03186/lib/fs.js#L151). If this makes sense, it would explain why importing graceful-fs seems to effect fs too (i think?). I have included code to show what I mean. Using
|
This commit fixes issue isaacs#35
@cainjonm, you are correct. The main issue here is breaking the global fs module by changing the Stats constructor that the native code uses. PR #42 fixes it. For the time being if you want to fix it in your code, you can add the following lines after the first load of gfs: var binding = process.binding('fs')
if (binding.FSInitialize) {
binding.FSInitialize(fs.Stats)
gfs.Stats = fs.Stats
} |
This seems to be resolved in graceful-fs v4.x, right? |
Yes, it's resolved. |
Result of
fs.lstatSync()
isn't instance offs.Stats
with[email protected]
on Node.js 0.11. This problem doesn't occur with[email protected]
.Example code (
index.js
) as follows.[email protected]
:[email protected]
:The text was updated successfully, but these errors were encountered: