-
Notifications
You must be signed in to change notification settings - Fork 266
Use zcat instead of zless #2509
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -154,7 +154,7 @@ sub process_data | |||||
| my ($opts) = @_; | ||||||
|
|
||||||
| print STDERR "Parsing $$opts{outdir}/roh.txt\n"; | ||||||
| open(my $in,"zless $$opts{roh_file} |") or error("zless $$opts{roh_file}: $!"); | ||||||
| open(my $in,"zcat $$opts{roh_file} |") or error("zcat $$opts{roh_file}: $!"); | ||||||
|
||||||
| open(my $in,"zcat $$opts{roh_file} |") or error("zcat $$opts{roh_file}: $!"); | |
| open(my $in, '-|', 'zcat', $$opts{roh_file}) or error("zcat $$opts{roh_file}: $!"); |
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The close error message references $$opts{in_file}, but this function opens $$opts{roh_file} and there is no in_file option in this script. This will produce a misleading/empty error message if the pipe fails; update it to refer to the RoH input and ideally include the underlying failure info (e.g., $! and/or $?).
| close($in) or error("close failed: zcat $$opts{in_file}"); | |
| close($in) or error("close failed: zcat $$opts{roh_file} (status=$?, error=$!)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
zcathere will fail for the common case where--RoH-fileis plain text (the help example usesroh.txt, not a.gz).zlesscan view uncompressed files, butzcattypically errors with “not in gzip format” and produces no parsed data. Consider opening the file directly when it’s not gzipped (e.g., based on extension or magic bytes), and only using a decompressor for.gzinputs (or useIO::Uncompress::Gunzipfor gzip with a plain-file fallback).