Skip to content

Feature: friendlier treatment of huge files #529

@epa

Description

@epa

Currently ack searches files in the order it finds them. But you may have a working directory containing your code, plus some huge log file or input file or whatever. Searching could spend a long time looking through that file before it gets to the smaller and quicker files.

It would be better to tweak the order so that big files (more than a megabyte, say) are searched last. So ack would first of all look in all the small files, and then go on to check the big ones at the end, doing the very biggest last of all. This would increase the chance of being able to see the match you were looking for and hit Ctrl-C. Of course, all the same matches would still be found as before.

A further enhancement would be to print a message 'scanning large file X' to the console if X is bigger than ten megabytes and ack has spent more than ten seconds reading it so far. Then the user has an opportunity to interrupt and perhaps delete or move that file before rerunning ack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions