ObjectStat
Basic information object of the file
Stat objects passfs.stat,File.stat,fs.readdirQuery, cannot be created independently
inheritance relationship
member properties
name
String, file name
1readonly String Stat.name;
dev
Integer, contains the device ID of the file
1readonly Integer Stat.dev;
ino
Integer, the number of Inodes in the file
1readonly Integer Stat.ino;
mode
Integer, file permission, 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 special types of files, 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 in I/O operations
1readonly Integer Stat.blksize;
blocks
Integer, the number of blocks allocated to this file
1readonly Integer Stat.blocks;
mtime
Date, the time the file was last modified
1readonly Date Stat.mtime;
mtimeMs
Number, file last modified 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 creation time
1readonly Date Stat.birthtime;
birthtimeMs
Number, file creation time (ms)
1readonly Number Stat.birthtimeMs;
member function
isWritable
Check whether the file has write permission
1Boolean Stat.isWritable();
Return results:
- Boolean, if true, there is write permission
isReadable
Check whether a file has read permission
1Boolean Stat.isReadable();
Return results:
- Boolean, if true, there is read permission.
isExecutable
Check whether a file has execution permissions
1Boolean Stat.isExecutable();
Return results:
- Boolean, if true, there is execution permission
isHidden
Check whether a file is hidden
1Boolean Stat.isHidden();
Return results:
- Boolean, if true, hide
isBlockDevice
Query whether Stat describes a block device
1Boolean Stat.isBlockDevice();
Return results:
- Boolean, if true, indicates that a block device is described
isCharacterDevice
Query whether Stat describes a character device
1Boolean Stat.isCharacterDevice();
Return results:
- Boolean, if true, it means that a character device is described
isDirectory
Query whether a file is a directory
1Boolean Stat.isDirectory();
Return results:
- Boolean, if true, it is the directory
isFIFO
Query whether Stat describes a FIFO pipe
1Boolean Stat.isFIFO();
Return results:
- Boolean, if true, indicates that a FIFO pipe is described
isFile
Query whether a file is a file
1Boolean Stat.isFile();
Return results:
- Boolean, if true, it is a file
isSymbolicLink
Query whether a file is a symbolic link
1Boolean Stat.isSymbolicLink();
Return results:
- Boolean, if true, it is a symbolic link
isMemory
Query whether the file is a memory file
1Boolean Stat.isMemory();
Return results:
- Boolean, if true, it is a memory file
isSocket
Query whether the file isSocket
1Boolean Stat.isSocket();
Return results:
- Boolean, if it is true, thenSocket
toString
Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.
1String Stat.toString();
Return results:
- String, returns the string representation of the object
toJSON
Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.
1Value Stat.toJSON(String key = "");
Call parameters:
- key: String, not used
Return results:
- Value, returns a value containing JSON serializable