On windows, stat() doesn't give you block (size) info
authorBert Belder <bertbelder@gmail.com>
Thu, 25 Nov 2010 00:26:19 +0000 (01:26 +0100)
committerBert Belder <bertbelder@gmail.com>
Mon, 20 Dec 2010 22:50:43 +0000 (23:50 +0100)
src/node_file.cc

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