method fs.list
Entries of a directory sorted by name (. and .. are not listed).
Example:
use std.io { File, fs }
fn main() io {
let dir = fs.tempDir()!
File.writeText("{dir}/a", "")!
File.writeText("{dir}/b", "")!
print("{fs.list(dir)!.len()}")
fs.removeAll(dir)!
}Вывод
2
pub(api) static fn list(path: str) -> List<DirEntry> | IoError ioС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
path | str |
Возвращает
Ошибки
IoError@error
Эффекты
io
Определено в: std/io/io.oxl:629