Object Stat
Basic information object
Stat object passed fs.stat, File.stat, fs.readdir Query, cannot be created independently
Inheritance
Member attributes
name
String, file name
1readonly String Stat.name;
dev
Integer, the device ID that contains the file
1readonly Integer Stat.dev;
ino
Integer, the number of Inodes in the file
1readonly Integer Stat.ino;
mode
Integer, file permissions, Windows does not support this attribute
1readonly Integer Stat.mode;
nlink
Integer, the number of hard links associated with this file
1readonly Integer Stat.nlink;
uid
Integer, the id of the file owner
1readonly Integer Stat.uid;
gid
Integer, the group id to which the file belongs
1readonly Integer Stat.gid;
rdev
Integer, for a special type of file, contains the device ID of the file
1readonly Integer Stat.rdev;
size
Number, file size
1readonly Number Stat.size;
blksize
Integer, file system block size during I/O operations
1readonly Integer Stat.blksize;
blocks
Integer, the number of blocks allocated to the file
1readonly Integer Stat.blocks;
mtime
Date, the last modification time of the file
1readonly Date Stat.mtime;
mtimeMs
Number, file last modification time (ms)
1readonly Number Stat.mtimeMs;
atime
Date, file last access time
1readonly Date Stat.atime;
atimeMs
Number, file last access time (ms)
1readonly Number Stat.atimeMs;
ctime
Date, file creation time
1readonly Date Stat.ctime;
ctimeMs
Number, file creation time (ms)
1readonly Number Stat.ctimeMs;
birthtime
Date, file generation time
1readonly Date Stat.birthtime;
birthtimeMs
Number, file generation time (ms)
1readonly Number Stat.birthtimeMs;
Member function
isWritable
Check whether the file has write permission
1Boolean Stat.isWritable();
Return result:
- Boolean, Is true to have write permission
isReadable
Check whether the file has read permission
1Boolean Stat.isReadable();
Return result:
- Boolean, If it is true, it has read permission
isExecutable
Query whether the file has execute permission
1Boolean Stat.isExecutable();
Return result:
- Boolean, If true, execute permission
isHidden
Check whether the file is hidden
1Boolean Stat.isHidden();
Return result:
- Boolean, Hidden if true
isBlockDevice
Query whether Stat describes a block device
1Boolean Stat.isBlockDevice();
Return result:
- Boolean, True means a block device is described
isCharacterDevice
Query whether Stat describes a character device
1Boolean Stat.isCharacterDevice();
Return result:
- Boolean, True means that a character device is described
isDirectory
Query whether the file is a directory
1Boolean Stat.isDirectory();
Return result:
- Boolean, True is the directory
isFIFO
Query whether Stat describes a FIFO pipe
1Boolean Stat.isFIFO();
Return result:
- Boolean, True means that a FIFO pipeline is described
isFile
Check whether the file is a file
1Boolean Stat.isFile();
Return result:
- Boolean, True is the file
isSymbolicLink
Query whether the file is a symbolic link
1Boolean Stat.isSymbolicLink();
Return result:
- Boolean, True is a symbolic link
isMemory
Query whether the file is a memory file
1Boolean Stat.isMemory();
Return result:
- Boolean, True is the memory file
isSocket
Check if the file is Socket
1Boolean Stat.isSocket();
Return result:
- Boolean, If true is Socket
toString
Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics
1String Stat.toString();
Return result:
- String, Returns the string representation of the object
toJSON
Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object
1Value Stat.toJSON(String key = "");
Call parameters:
- key: String, unused
Return result:
- Value, Returns a value containing JSON serializable