Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Run path.exists paths through _makeLong
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Feb 2, 2012
1 parent 5166758 commit a661830
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/path.js
Expand Up @@ -402,23 +402,23 @@ exports.extname = function(path) {


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);
});
};


exports.existsSync = function(path) {
try {
process.binding('fs').stat(path);
process.binding('fs').stat(_makeLong(path));
return true;
} catch (e) {
return false;
}
};


exports._makeLong = isWindows ?
var _makeLong = exports._makeLong = isWindows ?
function(path) {
var resolvedPath = exports.resolve(path);

Expand Down

0 comments on commit a661830

Please sign in to comment.