Run path.exists paths through _makeLong
This commit is contained in:
parent
5166758927
commit
a661830569
@ -402,7 +402,7 @@ exports.extname = function(path) {
|
|||||||
|
|
||||||
|
|
||||||
exports.exists = function(path, callback) {
|
exports.exists = function(path, callback) {
|
||||||
process.binding('fs').stat(path, function(err, stats) {
|
process.binding('fs').stat(_makeLong(path), function(err, stats) {
|
||||||
if (callback) callback(err ? false : true);
|
if (callback) callback(err ? false : true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -410,7 +410,7 @@ exports.exists = function(path, callback) {
|
|||||||
|
|
||||||
exports.existsSync = function(path) {
|
exports.existsSync = function(path) {
|
||||||
try {
|
try {
|
||||||
process.binding('fs').stat(path);
|
process.binding('fs').stat(_makeLong(path));
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
@ -418,7 +418,7 @@ exports.existsSync = function(path) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
exports._makeLong = isWindows ?
|
var _makeLong = exports._makeLong = isWindows ?
|
||||||
function(path) {
|
function(path) {
|
||||||
var resolvedPath = exports.resolve(path);
|
var resolvedPath = exports.resolve(path);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user