feat: add File.stat() method and Stat class for filesystem metadata queries
Implement asynchronous stat() on File class returning a new Stat object with device, inode, mode, linkCount, user, group, specialDevice, size, blockSize, and blockCount fields populated from libuv uv_fs_stat callback. Register foreign method statPath_ in module registry, bump MAX_METHODS_PER_CLASS to 10, add Stat class to io.wren with indexed field accessors, update documentation index with Stat page, and include test coverage for stat on existing file and nonexistent path.
2016-01-01 18:58:44 +01:00
|
|
|
^title Stat Class
|
|
|
|
|
|
2016-02-07 18:56:16 +01:00
|
|
|
A data structure describing the low-level details of a file system entry.
|
feat: add File.stat() method and Stat class for filesystem metadata queries
Implement asynchronous stat() on File class returning a new Stat object with device, inode, mode, linkCount, user, group, specialDevice, size, blockSize, and blockCount fields populated from libuv uv_fs_stat callback. Register foreign method statPath_ in module registry, bump MAX_METHODS_PER_CLASS to 10, add Stat class to io.wren with indexed field accessors, update documentation index with Stat page, and include test coverage for stat on existing file and nonexistent path.
2016-01-01 18:58:44 +01:00
|
|
|
|
2016-02-07 18:56:16 +01:00
|
|
|
## Static Methods
|
|
|
|
|
|
|
|
|
|
### Stat.**path**(path)
|
|
|
|
|
|
|
|
|
|
"Stats" the file or directory at `path`.
|
feat: add File.stat() method and Stat class for filesystem metadata queries
Implement asynchronous stat() on File class returning a new Stat object with device, inode, mode, linkCount, user, group, specialDevice, size, blockSize, and blockCount fields populated from libuv uv_fs_stat callback. Register foreign method statPath_ in module registry, bump MAX_METHODS_PER_CLASS to 10, add Stat class to io.wren with indexed field accessors, update documentation index with Stat page, and include test coverage for stat on existing file and nonexistent path.
2016-01-01 18:58:44 +01:00
|
|
|
|
|
|
|
|
## Methods
|
|
|
|
|
|
|
|
|
|
### **device**
|
|
|
|
|
|
|
|
|
|
The ID of the device containing the entry.
|
|
|
|
|
|
|
|
|
|
### **inode**
|
|
|
|
|
|
|
|
|
|
The [inode][] number of the entry.
|
|
|
|
|
|
|
|
|
|
[inode]: https://en.wikipedia.org/wiki/Inode
|
|
|
|
|
|
|
|
|
|
### **mode**
|
|
|
|
|
|
|
|
|
|
A bit field describing the entry's type and protection flags.
|
|
|
|
|
|
|
|
|
|
### **linkCount**
|
|
|
|
|
|
|
|
|
|
The number of hard links to the entry.
|
|
|
|
|
|
|
|
|
|
### **user**
|
|
|
|
|
|
|
|
|
|
Numeric user ID of the file's owner.
|
|
|
|
|
|
|
|
|
|
### **group**
|
|
|
|
|
|
|
|
|
|
Numeric group ID of the file's owner.
|
|
|
|
|
|
|
|
|
|
### **specialDevice**
|
|
|
|
|
|
|
|
|
|
The device ID for the entry, if it's a special file.
|
|
|
|
|
|
|
|
|
|
### **size**
|
|
|
|
|
|
|
|
|
|
The size of the entry in bytes.
|
|
|
|
|
|
|
|
|
|
### **blockSize**
|
|
|
|
|
|
|
|
|
|
The preferred block size in bytes for interacting with the file. It may vary
|
|
|
|
|
from file to file.
|
|
|
|
|
|
|
|
|
|
### **blockCount**
|
|
|
|
|
|
|
|
|
|
The number of system blocks allocated on disk for the file.
|