summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Zinkovsky <igorzi@microsoft.com>2012-05-22 16:02:10 -0700
committerIgor Zinkovsky <igorzi@microsoft.com>2012-05-24 01:15:15 -0700
commit39e25528eb769c36e2f8fa534861a23822c819fb (patch)
tree1e74885094a3fb0a94cff227e99c60b31c8d1bb6 /src
parenta2fcc47772546faecda1bca6140d87341246bff9 (diff)
downloadnode-39e25528eb769c36e2f8fa534861a23822c819fb.tar.gz
windows: enable creating directory junctions with fs.symlink
Diffstat (limited to 'src')
-rw-r--r--src/node_file.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index 73a97a11d..65f07a5bd 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -414,8 +414,13 @@ static Handle<Value> Symlink(const Arguments& args) {
if (args[2]->IsString()) {
String::Utf8Value mode(args[2]);
- if (memcmp(*mode, "dir\0", 4) == 0) {
+ if (strcmp(*mode, "dir") == 0) {
flags |= UV_FS_SYMLINK_DIR;
+ } else if (strcmp(*mode, "junction") == 0) {
+ flags |= UV_FS_SYMLINK_JUNCTION;
+ } else if (strcmp(*mode, "file") != 0) {
+ return ThrowException(Exception::Error(
+ String::New("Unknown symlink type")));
}
}