Browse Source

Return chunk & bytes read for posix.readSync()

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
cd41e30bcc
  1. 5
      src/node_file.cc

5
src/node_file.cc

@ -421,7 +421,10 @@ static Handle<Value> Read(const Arguments& args) {
ret = pread(fd, buf, MIN(len, READ_BUF_LEN), offset);
}
if (ret < 0) return ThrowException(errno_exception(errno));
return scope.Close(Integer::New(ret));
Local<Array> a = Array::New(2);
a->Set(Integer::New(0), Encode(buf, ret, encoding));
a->Set(Integer::New(1), Integer::New(ret));
return scope.Close(a);
}
}

Loading…
Cancel
Save