fs.js
function stat(path, callback) {
  if (!callback) return stat.bind(this, path);
  fs.lstat(path, function (err, stat) {
    if (err) return callback(err);
    var ctime = stat.ctime / 1000;
    var cseconds = Math.floor(ctime);
    var mtime = stat.mtime / 1000;
    var mseconds = Math.floor(mtime);
    var mode;
    if (stat.isSymbolicLink()) {
      mode = 0120000;
    }
    else if (stat.mode & 0111) {
      mode = 0100755;
    }
    else {
      mode = 0100644;
    }
    callback(null, {
      ctime: [cseconds, Math.floor((ctime - cseconds) * 1000000000)],
      mtime: [mseconds, Math.floor((mtime - mseconds) * 1000000000)],
      dev: stat.dev,
      ino: stat.ino,
      mode: mode,
      uid: stat.uid,
      gid: stat.gid,
      size: stat.size
    });
  });
}
function stat(path, callback) {
  if (!callback) return stat.bind(this, path);
  fs.lstat(path, function (err, stat) {
    if (err) return callback(err);
    var ctime = stat.ctime / 1000;
    var cseconds = Math.floor(ctime);
    var mtime = stat.mtime / 1000;
    var mseconds = Math.floor(mtime);
    var mode;
    if (stat.isSymbolicLink()) {
      mode = 0120000;
    }
    else if (stat.mode & 0111) {
      mode = 0100755;
    }
    else {
      mode = 0100644;
    }
    callback(null, {
      ctime: [cseconds, Math.floor((ctime - cseconds) * 1000000000)],
      mtime: [mseconds, Math.floor((mtime - mseconds) * 1000000000)],
      dev: stat.dev,
      ino: stat.ino,
      mode: mode,
      uid: stat.uid,
      gid: stat.gid,
      size: stat.size
    });
  });
}
function stat ( path , callback ) { if ( ! callback ) return stat . bind ( this , path ) ; fs . lstat ( path , function ( err , stat ) { if ( err ) return callback ( err ) ; var ctime = stat . ctime / 1000 ; var cseconds = Math . floor ( ctime ) ; var mtime = stat . mtime / 1000 ; var mseconds = Math . floor ( mtime ) ; var mode ; if ( stat . isSymbolicLink ( ) ) { mode = 0120000 ; } else if ( stat . mode & 0111 ) { mode = 0100755 ; } else { mode = 0100644 ; } callback ( null , { ctime : [ cseconds , Math . floor ( ( ctime - cseconds ) * 1000000000 ) ] , mtime : [ mseconds , Math . floor ( ( mtime - mseconds ) * 1000000000 ) ] , dev : stat . dev , ino : stat . ino , mode : mode , uid : stat . uid , gid : stat . gid , size : stat . size } ) ; } ) ; }
Given a path, return a continuable for the stat object.
Given a path return a continuable for the stat object .