Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!hplabs!hao!seismo!lll-crg!qantel!ptsfa!ski!dr From: dr@ski.UUCP (David Robins) Newsgroups: net.micro.apple Subject: Re: Help with DOS 3.3 write end of file Message-ID: <225@ski.UUCP> Date: Sat, 1-Feb-86 19:12:57 EST Article-I.D.: ski.225 Posted: Sat Feb 1 19:12:57 1986 Date-Received: Wed, 5-Feb-86 01:44:54 EST References: <189@noscvax.UUCP> > > Help! since my Lines: 46 2 Feb 86 00:12:57 GMT Distribution: usa Organization: Smith-Kettlewell Institute, S.F., CA. Lines: 41 > Ted > milnet address "medin@nosc-shark" Although you didn't specify, I assume you are dealing with a SEQUENTIAL text file. If you look in the Apple DOS Programmer's Manual, page 66, the answer is right there. "This section gives you a new use for OPEN. Suppose your program routinely replaces an old text file with a new one with the same name. When the new one is shorter than the old one, the new one will have part of the old file hanging on the the end unless the program first deletes the old one. If you don't want this extra text at the end of the file, delete the old file before writing to the new one. The next program shows you how to delete a file and open it for new data, whether or not the file already exists." .................................... 40 PRINT D$;"OPEN ";FILE$ 50 PRINT D$;"DELETE ";FILE$ 60 PRINT D$;"OPEN ";FILE$ WRITE 160 PRINT D$;"CLOSE ";FILE$ I believe the EOF marker is a 00, (see Beneath Apple DOS) which I THINK is placed there by the CLOSEing of a file. I don't know why overwriting a sequential text file and ending it in a 00 won't stop the extra text from getting in the way. In any case, most users follow the OPEN, DELETE, OPEN business to keep things straight. -- ==================================================================== David Robins, M.D. Smith-Kettlewell Institute of Visual Sciences 2232 Webster St; San Francisco CA 94115 415/561-1705 {ihnp4,qantel,dual}!ptsfa!ski!dr The opinions expressed herein do not reflect the opinion of the Institute!