Browse Source

On windows, stat() doesn't give you block (size) info

v0.7.4-release
Bert Belder 14 years ago
parent
commit
51c6867280
  1. 2
      src/node_file.cc

2
src/node_file.cc

@ -253,11 +253,13 @@ Local<Object> BuildStatsObject(struct stat * s) {
/* total size, in bytes */ /* total size, in bytes */
stats->Set(size_symbol, Number::New(s->st_size)); stats->Set(size_symbol, Number::New(s->st_size));
#ifdef __POSIX__
/* blocksize for filesystem I/O */ /* blocksize for filesystem I/O */
stats->Set(blksize_symbol, Integer::New(s->st_blksize)); stats->Set(blksize_symbol, Integer::New(s->st_blksize));
/* number of blocks allocated */ /* number of blocks allocated */
stats->Set(blocks_symbol, Integer::New(s->st_blocks)); stats->Set(blocks_symbol, Integer::New(s->st_blocks));
#endif
/* time of last access */ /* time of last access */
stats->Set(atime_symbol, NODE_UNIXTIME_V8(s->st_atime)); stats->Set(atime_symbol, NODE_UNIXTIME_V8(s->st_atime));

Loading…
Cancel
Save