获取文件或目录的状态信息。
文件或目录的路径。
可选选项,包含 recursive 可递归获取目录下所有文件状态。
包含状态信息的异步操作结果。
const result = await stat('/path/to/file.txt');if (result.isOk()) { const stats = result.unwrap(); console.log(stats.isFile()); // true} Copy
const result = await stat('/path/to/file.txt');if (result.isOk()) { const stats = result.unwrap(); console.log(stats.isFile()); // true}
Optional
获取文件或目录的状态信息。
Param: path
文件或目录的路径。
Param: options
可选选项,包含 recursive 可递归获取目录下所有文件状态。
Returns
包含状态信息的异步操作结果。
Example