is_dir
fn is_dir(string path) -> Result<bool, IoError> Import
Source: use io::fs::{is_dir}; compiler/src/builtin_docs/io/fs.hy Returns whether path is a directory, following symbolic links.
A missing path is Ok(false). Needs --allow-read.
Parameters#
| Name | Type |
|---|---|
path | string |
Returns#
Result<bool, IoError>
Examples#
use io::fs::{is_dir};
use tests::assert;
let tmp = match is_dir("/tmp") {
Result::Ok(b) => b,
Result::Err(_) => false,
};
assert!(tmp);
See also#
copy: Copies the contents of filefromtoto, creating or overwritingto.create_dir: Creates the directorypath.create_dir_all: Creates the directorypathand any missing parent directories.exists: Returns whether anything exists atpath.is_file: Returns whetherpathis a regular file, following symbolic links.is_symlink: Returns whetherpathitself is a symbolic link (the link is not followed).list_dir: Returns the names of the entries in directorypath, sorted.metadata: Returns facts aboutpathas a record, without following a final symbolic link.