Object built-in object

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

1
readonly String Stat.name;

dev

Integer, contains the device ID of the file

1
readonly Integer Stat.dev;

ino

Integer, the number of Inodes in the file

1
readonly Integer Stat.ino;

mode

Integer, file permission, Windows does not support this attribute

1
readonly Integer Stat.mode;

Integer, the number of hard links associated with this file

1
readonly Integer Stat.nlink;

uid

Integer, the id of the file owner

1
readonly Integer Stat.uid;

gid

Integer, the group id to which the file belongs

1
readonly Integer Stat.gid;

rdev

Integer, for special types of files, contains the device ID of the file

1
readonly Integer Stat.rdev;

size

Number, file size

1
readonly Number Stat.size;

blksize

Integer, file system block size in I/O operations

1
readonly Integer Stat.blksize;

blocks

Integer, the number of blocks allocated to this file

1
readonly Integer Stat.blocks;

mtime

Date, the time the file was last modified

1
readonly Date Stat.mtime;

mtimeMs

Number, file last modified time (ms)

1
readonly Number Stat.mtimeMs;

atime

Date, file last access time

1
readonly Date Stat.atime;

atimeMs

Number, file last access time (ms)

1
readonly Number Stat.atimeMs;

ctime

Date, file creation time

1
readonly Date Stat.ctime;

ctimeMs

Number, file creation time (ms)

1
readonly Number Stat.ctimeMs;

birthtime

Date, file creation time

1
readonly Date Stat.birthtime;

birthtimeMs

Number, file creation time (ms)

1
readonly Number Stat.birthtimeMs;

member function

isWritable

Check whether the file has write permission

1
Boolean Stat.isWritable();

Return results:

  • Boolean, if true, there is write permission

isReadable

Check whether a file has read permission

1
Boolean Stat.isReadable();

Return results:

  • Boolean, if true, there is read permission.

isExecutable

Check whether a file has execution permissions

1
Boolean Stat.isExecutable();

Return results:

  • Boolean, if true, there is execution permission

isHidden

Check whether a file is hidden

1
Boolean Stat.isHidden();

Return results:

  • Boolean, if true, hide

isBlockDevice

Query whether Stat describes a block device

1
Boolean Stat.isBlockDevice();

Return results:

  • Boolean, if true, indicates that a block device is described

isCharacterDevice

Query whether Stat describes a character device

1
Boolean Stat.isCharacterDevice();

Return results:

  • Boolean, if true, it means that a character device is described

isDirectory

Query whether a file is a directory

1
Boolean Stat.isDirectory();

Return results:

  • Boolean, if true, it is the directory

isFIFO

Query whether Stat describes a FIFO pipe

1
Boolean Stat.isFIFO();

Return results:

  • Boolean, if true, indicates that a FIFO pipe is described

isFile

Query whether a file is a file

1
Boolean Stat.isFile();

Return results:

  • Boolean, if true, it is a file

Query whether a file is a symbolic link

1
Boolean Stat.isSymbolicLink();

Return results:

  • Boolean, if true, it is a symbolic link

isMemory

Query whether the file is a memory file

1
Boolean Stat.isMemory();

Return results:

  • Boolean, if true, it is a memory file

isSocket

Query whether the file isSocket

1
Boolean 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.

1
String 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.

1
Value Stat.toJSON(String key = "");

Call parameters:

  • key: String, not used

Return results:

  • Value, returns a value containing JSON serializable