method fs.createDir
Creates one directory; fails with AlreadyExists if it exists and with NotFound if the parent is missing.
Example:
use std.io { File, fs }
fn main() io {
let dir = fs.tempDir()!
fs.createDir("{dir}/sub")!
print("{File.isDir("{dir}/sub")}")
fs.removeAll(dir)!
}Вывод
true
pub(api) static fn createDir(path: str) -> () | IoError ioС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
path | str |
Возвращает
()
Ошибки
IoError@error
Эффекты
io
Определено в: std/io/io.oxl:664