Notes:
- Currently only accepts numeric user and group ids.
- No tests, as tests depend on getpwuid and getgrgid.
- No documentation, as there is no tests and this is experimental.
This patch makes buffers the preferred output for fs.read() and
fs.readSync(). The old string interface is still supported by
converting buffers to strings dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
This patch makes buffers the preferred output for fs.read() and
fs.readSync(). The old string interface is still supported by
converting buffers to strings dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
This patch makes buffers the preferred input for fs.write() and
fs.writeSync(). The old string interface is still supported by
converting strings to buffers dynamically. This allows to remove the
C++ code for string handling which is also part of this patch.
At the same time implement synchronous wrappers of the POSIX functions.
These will be undocumented until we settle on an API. Works like this
// returns promise as before
posix.mkdir("test").addCallback(function () {
sys.puts("done");
});
// returns undefined, executed synchronously.
posix.mkdirSync("test");
sys.puts("done");
This refactoring is a step towards allowing promises to be implemented
purely in javascript.
This is because it would call the javascript initializer which executed
Promise::New, and then it would rewrap the handle. Instead I make an
explicit inheritance from EIOPromise to Promise.
This seems to fix a memory leak which was reported by Ray Morgan:
http://groups.google.com/group/nodejs/browse_thread/thread/e38949b1989da1d7