Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!ucsd!ucbvax!hplabs!hp-sdd!megatek!tsunami!hollen From: hollen@tsunami.megatek.uucp (Dion Hollenbeck) Newsgroups: comp.sys.ibm.pc Subject: Re: Chopping an existing file Message-ID: <365@megatek.UUCP> Date: 8 Aug 88 14:09:08 GMT References: <472@apr.UUCP> Sender: news@megatek.UUCP Distribution: na Lines: 18 > In article <290@ncextb.ncsu.edu> erdman@ncextb.ncsu.edu (erdman) writes: > > I am looking for a way to shorting the length of an existing file >without re-writing the whole file. I know it can be done, dBase III's >"pack" appears to do this. Are there any reliable ways to do this? >Any help would be appreciated. Look in the back of the DOS Programmer's Reference Manual for the File Control Block format. Use the old style file open which uses the FCB. Just poke the length field with the new length you want and tell DOS to close the file. The new FCB with new length will be written back to disk. Dion Hollenbeck (619) 455-5590 x2814 Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121 seismo!s3sun!megatek!hollen ames!scubed/