Skip to content

Commit

Permalink
Switched from fs::read_to_string("/bin/ls") to fs::read("/bin/ls")
Browse files Browse the repository at this point in the history
since "/bin/ls" is a non-UTF8 executable binary.
  • Loading branch information
kkysen committed Jan 24, 2021
1 parent 2f64a5f commit deecf2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn async_api() {
block_on(async {
let mut driver = fanotify.buffered_default().to::<Driver>().into_async()?;
let path = Path::new("/bin/ls");
fs::read_to_string(path)?;
fs::read(path)?; // not fs::read_to_string since this /bin/ls is an executable
let event = driver.read1().await?;
assert_eq!(event.mask(), Mask::OPEN | Mask::ACCESS);
assert_eq!(event.into_file().path().unwrap().unwrap().as_path(), path);
Expand Down

0 comments on commit deecf2c

Please sign in to comment.