Comment 1 for bug 510613

Revision history for this message
Mark Nieweglowski (lp-0) wrote :

Attached is a patch so "look" will accept files larger than INT_MAX on 64 bit architectures.

The original debian/patches/look.diff allows look.c to compile on Debian by defining SIZE_T_MAX as INT_MAX.

But it should have defined SIZE_T_MAX as SIZE_MAX.

SIZE_MAX is defined in stdint.h which wasn't included before, so this patch adds an #include <stdint.h>

stdint.h should be available on Debian since it is provided by package libc6-dev.

I just learned about "look" last week, as a utility that does a binary search on sorted files.

I tried it at work to look through a 33G log file.

Instead of grep '^2011-05-27 11:32' some.log # waiting minutes

look '2011-05-27 11:32' some.log # hoped it would be faster than grep, instead I got
look: some.log: File too large # :(

I found out about look via

http://www.reddit.com/r/blog/comments/fjgit

and "look -b" sounds like the appropriate tool but fails unreasonably on 64 bit architectures.