mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-10 06:15:35 -05:00
Merge commit 'fec26926a8' as 'tokio-tar'
This commit is contained in:
commit
18ba8f49c4
34 changed files with 6427 additions and 0 deletions
21
tokio-tar/examples/list.rs
Normal file
21
tokio-tar/examples/list.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//! An example of listing the file names of entries in an archive.
|
||||
//!
|
||||
//! Takes a tarball on stdin and prints out all of the entries inside.
|
||||
|
||||
extern crate tokio_tar as async_tar;
|
||||
|
||||
use tokio::io::stdin;
|
||||
use tokio_stream::*;
|
||||
|
||||
use async_tar::Archive;
|
||||
|
||||
fn main() {
|
||||
tokio::runtime::Runtime::new().unwrap().block_on(async {
|
||||
let mut ar = Archive::new(stdin());
|
||||
let mut entries = ar.entries().unwrap();
|
||||
while let Some(file) = entries.next().await {
|
||||
let f = file.unwrap();
|
||||
println!("{}", f.path().unwrap().display());
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue