Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site cwruecmp.UUCP Path: utzoo!linus!philabs!prls!amdimage!amdcad!decwrl!decvax!cwruecmp!simpsong From: simpsong@cwruecmp.UUCP (Greg) Newsgroups: net.unix-wizards Subject: help with dir. structure sysV vs. 4.2BSD Message-ID: <1290@cwruecmp.UUCP> Date: Thu, 15-Aug-85 18:18:34 EDT Article-I.D.: cwruecmp.1290 Posted: Thu Aug 15 18:18:34 1985 Date-Received: Tue, 20-Aug-85 03:42:52 EDT Organization: CWRU Dept. Computer Eng., Cleveland, OH Lines: 31 *** 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@CSNET-RELAY.CSNET