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

Utilities/wc: Seek the input file(s) if only -c is passed #24499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

supercomputer7
Copy link
Member

@supercomputer7 supercomputer7 commented May 31, 2024

If the user only wants to get the byte count of a set of files, then for each file we can simply seek it to get the byte count instead of iterating over all the bytes.

Revives #21961. The original PR had a bug in which -c wouldn't be able to handle standard input stream, but now I added a condition to handle ESPIPE error as well.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 31, 2024
If the user only wants to get the byte count of a set of files, then for
each file we can simply seek it to get the byte count instead of
iterating over all the bytes.
@supercomputer7 supercomputer7 changed the title wc: Seek the input file(s) if only -c is passed Utilities/wc: Seek the input file(s) if only -c is passed Jun 1, 2024
Copy link

stale bot commented Jun 26, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

@stale stale bot added the stale label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants