Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.rs #26

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@
.iter()
.map(|p| fs::canonicalize(p).unwrap())
.collect::<Vec<_>>();
let pid = opt.pid;
let fds = find_fds_for_open_file(pid, &absolute_paths)?;

Check failure on line 58 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (stable)

cannot find value `pid` in this scope

Check failure on line 58 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (beta)

cannot find value `pid` in this scope

Check failure on line 58 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (nightly)

cannot find value `pid` in this scope

let m = indicatif::MultiProgress::new();

let mut thread_handles = vec![];
for (fd, path) in fds {
let file_size = fs::metadata(format!("/proc/{pid}/fd/{fd}"))?.len();

Check failure on line 64 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (stable)

cannot find value `pid` in this scope

Check failure on line 64 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (beta)

cannot find value `pid` in this scope

Check failure on line 64 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (nightly)

cannot find value `pid` in this scope
let pb = m.add(indicatif::ProgressBar::new(file_size));
pb.set_style(
indicatif::ProgressStyle::default_bar()
Expand All @@ -71,11 +70,11 @@
);
pb.set_message(format!(
"/proc/{}/fd/{} => {}",
pid,

Check failure on line 73 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (stable)

cannot find value `pid` in this scope

Check failure on line 73 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (beta)

cannot find value `pid` in this scope

Check failure on line 73 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (nightly)

cannot find value `pid` in this scope
fd,
path.file_name().unwrap().to_string_lossy()
));
let mut fdinfo = fs::File::open(format!("/proc/{pid}/fdinfo/{fd}"))?;

Check failure on line 77 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (stable)

cannot find value `pid` in this scope

Check failure on line 77 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (beta)

cannot find value `pid` in this scope

Check failure on line 77 in src/main.rs

View workflow job for this annotation

GitHub Actions / ci (nightly)

cannot find value `pid` in this scope
#[allow(clippy::verbose_file_reads)]
thread_handles.push(thread::spawn(move || {
let mut contents = String::new();
Expand Down
Loading