-
Notifications
You must be signed in to change notification settings - Fork 138
Description
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.