Object built-in object

Object Stat

File's base information object

Stat objects are fs.stat via fs.stat , File.stat , fs.readdir , and cannot be created independently

Inheritance

Member attributes

name

String, file name

1
readonly String Stat.name;

size

Long, file size

1
readonly Long Stat.size;

mode

Integer, file permissions, not supported by Windows

1
readonly Integer Stat.mode;

mtime

Date, file last modified time

1
readonly Date Stat.mtime;

atime

Date, last file access time

1
readonly Date Stat.atime;

ctime

Date, file creation time

1
readonly Date Stat.ctime;

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;

Member function

isWritable

Query whether the file has write permission

1
Boolean Stat.isWritable();

Returns the result:

  • Boolean , if true, has write permission

isReadable

Query whether the file has read permission

1
Boolean Stat.isReadable();

Returns the result:

  • Boolean , if true, read permission

isExecutable

Query whether the file has execute permission

1
Boolean Stat.isExecutable();

Returns the result:

  • Boolean , if true, execute permission

isHidden

Query whether the file is hidden

1
Boolean Stat.isHidden();

Returns the result:

  • Boolean , if true, hide

isDirectory

Query if the file is a directory

1
Boolean Stat.isDirectory();

Returns the result:

  • Boolean , if true, the directory

isFile

Query whether the file is a file

1
Boolean Stat.isFile();

Returns the result:

  • Boolean , true if it is a file

Query if the file is a symbolic link

1
Boolean Stat.isSymbolicLink();

Returns the result:

  • Boolean , true if it is a symbolic link

isMemory

Query whether the file is a memory file

1
Boolean Stat.isMemory();

Returns the result:

  • Boolean , if true, it is a memory file

isSocket

Query whether the file is a Socket

1
Boolean Stat.isSocket();

Returns the result:

  • Boolean , if true it is Socket

toString

Returns a string representation of the object, usually "[Native Object]". Objects can be reimplemented according to their own characteristics

1
String Stat.toString();

Returns the result:

  • String , returns a string representation of the object

toJSON

Returns a JSON representation of the object, typically returning a collection of readable properties defined by the object

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

Call parameters:

  • key : String, unused

Returns the result:

  • Value , returns a value containing a JSON serializable