Tauri readDir
2024-02-01 16:44 更新
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
[]>
以上内容是否对您有帮助:
更多建议: