Tauri readDir
readDir(: , :FsDirOptions
):Promise
<FileEntry
dir
string
options?
[]>
列出目录文件。
例
import { readDir, BaseDirectory } from '@tauri-apps/api/fs';
// Reads the `$APPDATA/users` directory recursively
const entries = await readDir('users', { dir: BaseDirectory.AppData, recursive: true });
function processEntries(entries) {
for (const entry of entries) {
console.log(`Entry: ${entry.path}`);
if (entry.children) {
processEntries(entry.children)
}
}
}
Since: 1.0.0
参数
名字 | 类型 |
---|---|
dir | string |
options | FsDirOptions |
Returns: Promise
<FileEntry
[]>