From 1f16a7b6e541694067178a022b9f7a082a6ce7f1 Mon Sep 17 00:00:00 2001 From: "Author: Igor Zinkovsky" Date: Fri, 25 Nov 2011 09:29:06 +0100 Subject: Enable long paths on windows --- lib/path.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/path.js') 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; + }; -- cgit v1.2.3