[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bsearch utility
From: |
Paul Eggert |
Subject: |
Re: bsearch utility |
Date: |
Thu, 21 Jul 2005 16:58:38 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Thanks for starting on this. Here's a quick reaction.
We should be implementing something upward-compatible with BSD
look(1). Visit <http://www.freebsd.org/cgi/man.cgi>, type "look", and
see the resulting man page.
You don't need to create a man page. They are created automatically,
from --help output. However, you do need to modify
doc/coreutils.texi.
There's a lot of code duplication between bsearch and source.
The common stuff should be factored out.
Always check for failure from every system call. E.g., fstat might
fail.
Please use the same coding style (e.g., indenting) that coreutils
already uses.
Why not use binary_search if the file is seekable? Some files are not
regular files, but are still seekable.
You should use an interpolating search rather than a straight binary
search. That is much faster for the common case of looking something
up in /usr/dict/words.
- bsearch utility, Sorav Bansal, 2005/07/14
- Re: bsearch utility, James Youngman, 2005/07/14
- Re: bsearch utility, Paul Eggert, 2005/07/14
- Re: bsearch utility, Sorav Bansal, 2005/07/21
- Re: bsearch utility,
Paul Eggert <=
- Re: bsearch utility, Sorav Bansal, 2005/07/22
- Re: bsearch utility, Paul Eggert, 2005/07/23
- Re: bsearch utility, Sorav Bansal, 2005/07/26
Re: bsearch utility, Bob Proulx, 2005/07/14
Re: bsearch utility, Sorav Bansal, 2005/07/14