FileSystemManager.statSync
JS
Stats | Object FileSystemManager.statSync(
string path,
boolean recursive)Get the file Stats object
The synchronous version of FileSystemManager.stat
Parameters
string path: Path of the directory to delete
boolean recursive: Whether to recursively get the info of all files in the directory
Return Value
Stats: When
recursiveis false, returns aStatsobject; see the table below for detailsObject: When
recursiveis true and path is a directory path, returns an Object whose key is the relative path with path as the root and whose value is the Stats object corresponding to that path
Properties of Stats
| Property | Type | Description |
|---|---|---|
| mode | string | The file type and access permissions, corresponding to POSIX stat.st_mode |
| size | number | File size, in bytes (B) |
| lastAccessedTime | number | The time the file was last accessed or executed, as a UNIX timestamp |
| lastModifiedTime | number | The time the file was last modified, as a UNIX timestamp |
Parameters of the captured exception
- error: Returns the error message; see the table below for valid values
Valid values of error:
| Error message | Description |
|---|---|
| no such file or directory | The file does not exist |
