help with dir. structure sysV vs. 4.2BSD

Greg simpsong at cwruecmp.UUCP
Fri Aug 16 08:18:34 AEST 1985


*** Is there a line eater out there.. ***

In K&P's book "The Unix Programming Enviroment"
a spelling correction algorithym is presented to
use with such things as paginators. (see spname 
in the index.) It is written for sysV/4.1 directory
structures. I am having trouble converting it to 4.2

It uses a low level read (shown below; it is in
mindist() ) to look at the directory. I believe this 
is the line which gives me trouble.

       while (read(fd,(char *) &nbuf, sizeof(struct direct)) > 0)

I think I should be using DIRSIZ(dp), instead of sizeof... but
this is where I get in over my head. Has anyone out there 
ported this to 4.2? I have the rest of the sources, but I
didn't want to post K&P's program without their permission.

Thanks in advance... p.s. If you don't have the book, buy it
it is worth the money...

If I get it working on 4.2 and sysV, and get permission to
post it... I will

Please send answers by mail. I will post a summary.

Gregory R. Simpson  ---  decvax!cwruecmp!simpsong

       or CSNET:  simpsong%case.csnet at CSNET-RELAY.CSNET



More information about the Comp.unix.wizards mailing list