
$ et [OPTIONS] [DIR]
主要参数:
-g, --glob <GLOB> 包含或排除文件(使用glob)
--iglob <IGLOB> 同上,不区分大小写
--glob-case-insensitive 不区分大小写处理所有 glob 模式
-H, --hidden 显示隐藏文件,默认不显示
--ignore-git 遍历隐藏文件时忽略.git; 默认不显示
-I, --icons 显示文件图标,默认不显示
-i, --ignore-git-ignore 忽略 .gitignore
-l, --level <NUM> 文件夹最大深度
-s, --sort <SORT> 排序 [默认:none] [可能的值: name, size, none]
-S, --follow-links 遍历链接目录并考虑磁盘使用情况,默认关闭

use picol::{read, block_on};
fn main() {
// Run the future on the current thread.
block_on(async {
let task1 = async {
println!("Task1 start");
let f = std::fs::File::open("examples/hello_world.rs").unwrap();
let r = read(&f, 0, 10).await;
let s = std::str::from_utf8(&r).unwrap();
println!("Task1: {}", s);
};
let task2 = async {
println!("Task2 start");
let f = std::fs::File::open("examples/hello_world.rs").unwrap();
let r = read(&f, 10, 10).await;
let s = std::str::from_utf8(&r).unwrap();
println!("Task2: {}", s);
};
futures_lite::future::zip(task1, task2).await;
});
}
原文作者:Rust语言中文社区;如有侵权,请联系管理员删除。