The FileSystemStats represents a particular FileSystemEntry's stats.
function FileSystemStats(options) {
var isFile = options.isFile;
this._isFile = isFile;
this._isDirectory = !isFile;
this._mtime = options.mtime;
this._size = options.size;
this._hash = options.hash;
var realPath = options.realPath;
if (realPath) {
if (!isFile && realPath[realPath.length - 1] !== "/") {
realPath += "/";
}
this._realPath = realPath;
}
}
// Add "isFile", "isDirectory", "mtime" and "size" getters
Object.defineProperties(FileSystemStats.prototype, {
"isFile": {
get: function () { return this._isFile; },
set: function () { throw new Error("Cannot set isFile"); }
},
"isDirectory": {
get: function () { return this._isDirectory; },
set: function () { throw new Error("Cannot set isDirectory"); }
},
"mtime": {
get: function () { return this._mtime; },
set: function () { throw new Error("Cannot set mtime"); }
},
"size": {
get: function () { return this._size; },
set: function () { throw new Error("Cannot set size"); }
},
"realPath": {
get: function () { return this._realPath; },
set: function () { throw new Error("Cannot set realPath"); }
}
});
Consistency hash for a file
FileSystemStats.prototype._hash = null;
Whether or not this is a stats object for a directory
FileSystemStats.prototype._isDirectory = false;
Whether or not this is a stats object for a file
FileSystemStats.prototype._isFile = false;
Modification time for a file
FileSystemStats.prototype._mtime = null;