This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Wrong fs.stat size on win32 #1647
Labels
Milestone
Comments
We may be mixing up |
Yes with this change size is correct (on XP) diff D:/INSTALL/AJAX/node/src/node.h D:/INSTALL/AJAX/node1/src/node.h
|
This bug should be closed after the next libuv update. |
Looks fixed to me. (msvc build @8153a21, xp sp3) var assert = require('assert');
var fs = require('fs');
var data = Buffer("Some data to test writing and stating afterwards");
// sync
var fd = fs.openSync('test.txt', 'w');
fs.writeSync(fd, data, 0, data.length, 0);
fs.close(fd);
var s = fs.statSync('test.txt');
assert.equal(s.size+1, data.length);
// async
fs.open('test.txt', 'w', function(err, fd) {
fs.write(fd, data, 0, data.length, 0, function(err, w, buf) {
if(w == data.length) {
fs.close(fd);
fs.stat('test.txt', function (err, stats) {
assert.equal(stats.size, data.length);
});
}
});
}); |
@cryptix: why the |
Oh no.. thats awkward.. i'm sorry. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
platform win32, MSVC build
fs.stat and fs.statSync return wrong size
The text was updated successfully, but these errors were encountered: