From 1937c5e3c14822045f1b7559ad2cd879ecc148ad Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 25 Nov 2010 01:27:37 +0100 Subject: [PATCH] On windows, there's no support (yet) for chown and symlink functions --- src/node_file.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/node_file.cc b/src/node_file.cc index ed289c40c8d..5ad5f4d3042 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -292,6 +292,7 @@ static Handle Stat(const Arguments& args) { } } +#ifdef __POSIX__ static Handle LStat(const Arguments& args) { HandleScope scope; @@ -310,6 +311,7 @@ static Handle LStat(const Arguments& args) { return scope.Close(BuildStatsObject(&s)); } } +#endif // __POSIX__ static Handle FStat(const Arguments& args) { HandleScope scope; @@ -330,6 +332,7 @@ static Handle FStat(const Arguments& args) { } } +#ifdef __POSIX__ static Handle Symlink(const Arguments& args) { HandleScope scope; @@ -348,7 +351,9 @@ static Handle Symlink(const Arguments& args) { return Undefined(); } } +#endif // __POSIX__ +#ifdef __POSIX__ static Handle Link(const Arguments& args) { HandleScope scope; @@ -367,7 +372,9 @@ static Handle Link(const Arguments& args) { return Undefined(); } } +#endif // __POSIX__ +#ifdef __POSIX__ static Handle ReadLink(const Arguments& args) { HandleScope scope; @@ -386,6 +393,7 @@ static Handle ReadLink(const Arguments& args) { return scope.Close(String::New(getbuf, bz)); } } +#endif // __POSIX__ static Handle Rename(const Arguments& args) { HandleScope scope; @@ -773,6 +781,7 @@ static Handle Chmod(const Arguments& args) { /* fs.chown(fd, uid, gid); * Wrapper for chown(1) / EIO_CHOWN */ +#ifdef __POSIX__ static Handle Chown(const Arguments& args) { HandleScope scope; @@ -796,6 +805,7 @@ static Handle Chown(const Arguments& args) { return Undefined(); } } +#endif // __POSIX__ void File::Initialize(Handle target) { HandleScope scope; @@ -812,16 +822,22 @@ void File::Initialize(Handle target) { NODE_SET_METHOD(target, "sendfile", SendFile); NODE_SET_METHOD(target, "readdir", ReadDir); NODE_SET_METHOD(target, "stat", Stat); +#ifdef __POSIX__ NODE_SET_METHOD(target, "lstat", LStat); +#endif // __POSIX__ NODE_SET_METHOD(target, "fstat", FStat); +#ifdef __POSIX__ NODE_SET_METHOD(target, "link", Link); NODE_SET_METHOD(target, "symlink", Symlink); NODE_SET_METHOD(target, "readlink", ReadLink); +#endif // __POSIX__ NODE_SET_METHOD(target, "unlink", Unlink); NODE_SET_METHOD(target, "write", Write); NODE_SET_METHOD(target, "chmod", Chmod); +#ifdef __POSIX__ NODE_SET_METHOD(target, "chown", Chown); +#endif // __POSIX__ errno_symbol = NODE_PSYMBOL("errno"); encoding_symbol = NODE_PSYMBOL("node:encoding");