summaryrefslogtreecommitdiff
path: root/lib/path.js
diff options
context:
space:
mode:
authorAuthor: Igor Zinkovsky <igorzi@microsoft.com>2011-11-25 09:29:06 +0100
committerBert Belder <bertbelder@gmail.com>2011-11-25 09:35:52 +0100
commit1f16a7b6e541694067178a022b9f7a082a6ce7f1 (patch)
tree82d6ae0faa8fd5838c6a924c1882a6052d934f49 /lib/path.js
parent319580953d69819e07b1162dd6dee218d0d5bb95 (diff)
downloadandroid-node-v8-1f16a7b6e541694067178a022b9f7a082a6ce7f1.tar.gz
android-node-v8-1f16a7b6e541694067178a022b9f7a082a6ce7f1.tar.bz2
android-node-v8-1f16a7b6e541694067178a022b9f7a082a6ce7f1.zip
Enable long paths on windows
Diffstat (limited to 'lib/path.js')
-rw-r--r--lib/path.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/path.js b/lib/path.js
index 162a15fc25..03d0807f75 100644
--- a/lib/path.js
+++ b/lib/path.js
@@ -417,3 +417,24 @@ exports.existsSync = function(path) {
return false;
}
};
+
+
+exports._makeLong = isWindows ?
+ function(path) {
+ var resolvedPath = exports.resolve(path);
+
+ if (resolvedPath.match(/^[a-zA-Z]\:\\/)) {
+ // path is local filesystem path, which needs to be converted
+ // to long UNC path.
+ return '\\\\?\\' + resolvedPath;
+ } else if (resolvedPath.match(/^\\\\[^?.]/)) {
+ // path is network UNC path, which needs to be converted
+ // to long UNC path.
+ return '\\\\?\\UNC\\' + resolvedPath.substring(2);
+ }
+
+ return path;
+ } :
+ function(path) {
+ return path;
+ };