refactor(dir) fs.lstat -> stat

This commit is contained in:
coderaiser 2014-04-07 04:11:00 -04:00
parent 1f37dfa553
commit 8b7251ba74

View file

@ -17,12 +17,18 @@
var main = global.cloudcmd.main,
fs = main.fs,
Util = main.util,
path = main.path;
path = main.path,
/* The lstat() function shall be equivalent to stat(),
except when path refers to a symbolic link. In that case lstat()
shall return information about the link, while stat() shall return
information about the file the link references.
*/
stat = fs.lstat.bind(fs);
exports.isDir = function(name, callback) {
name += '';
fs.stat(name, function(error, stat) {
stat(name, function(error, stat) {
var isDir;
if (!error)
@ -51,13 +57,7 @@
fileCounter = 1;
function getDirInfo(dir) {
/* The lstat() function shall be equivalent to stat(),
except when path refers to a symbolic link. In that case lstat()
shall return information about the link, while stat() shall return
information about the file the link references.
*/
fs.lstat(dir, Util.bind(getStat, dir));
stat(dir, Util.bind(getStat, dir));
}
function getStat(dir, error, stat) {