Systems Programming with Rust by Ken Youens-Clark

Systems Programming with Rust by Ken Youens-Clark

Author:Ken Youens-Clark [Ken Youens-Clark]
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2022-02-24T16:00:00+00:00


pub fn run(config: Config) -> MyResult<()> { for filename in &config.files { match open(filename) { Err(err) => eprintln!("{}: {}", filename, err), Ok(_file) => println!("Opened {}", filename), } } Ok(()) }

Using your open filehandle, start as simply as possible using the empty file and make sure your program prints zeros for the three columns of lines, words, and bytes:

$ cargo run -- tests/inputs/empty.txt 0 0 0 tests/inputs/empty.txt

Next use tests/inputs/fox.txt and make sure you get the following counts. I specifically added various kinds and numbers of whitespace to challenge you on how to split the text into words:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.