Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Wilhelm B. Kloke
Wed, 29 Jul 1992 13:22
Suggestion for locate & code
Author: Wilhelm B. Kloke
Date: Wed, 29 Jul 1992 13:22
Date: Wed, 29 Jul 1992 13:22
28 lines
1909 bytes
1909 bytes
Hallo,
in the GNU-find-3.7 distribution I found a bug which makes these programs
less useful in byte-sex-mixed NFS-environment.
The programs contain 1 call of getw/putw which makes them dependent on the
machine endianness. If I try to make databases for all the NFS-mounted
filesystems, I need them twice (or even more). Therefore I suggest
to change those calls. In a first try I added
int getw(FILE *fp) { register short x;
x=fgetc(fp)<<8; return x | fgetc(fp)&0xff; }
resp.
int putw(int c,FILE *fp) { fputc(c>>8,fp); fputc(c,fp); }
into the sources, which makes the database slightly shorter on 32-bit-word
machines.
I checked the redundancy of the resulting database by applying compress on
the file. This yielded a high compression rate. I looked for a reason for this
too. One possible solution may be to look for trigrams at the end. I have a
lot of files ending in t.f (Sources of NAG-library). This led to the result
that the most often encountered bigrams were t. and .f which are mutually
exclusive, which results in a highly suboptimal selection of bigrams.
There are some other trigrams at the end which are likely to occur:
.pk (TeX-Fonts), .3X (X11-Online-Manuals), .cc (C+-Sources), .el (EMacS).
This is just an observation, and not very important.
But I thought of a quick hack to change this.
One could reserve a quarter or half of the bigrams for those occurring
at the end of names. Then these trigrams would less likely be doubly
counted.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads