mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
refactor(dir) fs.lstat -> stat
This commit is contained in:
parent
1f37dfa553
commit
8b7251ba74
1 changed files with 9 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue