Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 from ihnp4 4.3bsd-beta 6/6/85; site chinet.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!chinet!bdw From: bdw@chinet.UUCP (Bill Wisner) Newsgroups: net.micro.cbm Subject: Re: (old) Sequential file problem Message-ID: <376@chinet.UUCP> Date: Thu, 27-Feb-86 18:37:59 EST Article-I.D.: chinet.376 Posted: Thu Feb 27 18:37:59 1986 Date-Received: Sat, 1-Mar-86 03:02:15 EST References: <687@ark.UUCP> Reply-To: bdw@chinet.UUCP (Bill Wisner) Organization: The Computer Connection Lines: 31 In article <687@ark.UUCP> lesmem@vu44.UUCP (Lesmeister Marco) writes: > > How can I write data to a sequential file and overwrite the old > file with the same name, when I don't know for sure if there is > a file with that name. > I know now that there is a problem when I use the '@' option > and there is no file to overwrite, but how do I solve this. > > I don't hope that the only solution is to check the directory > for the file-name, because that's a bore. > Just scratch the old file first. If the file DOES exist, than [boom!] it won't for long. If the file is NOT there, than your drive will rattle around a bit inside it's casing [you should be used to that], but no damage done. The error channel will be cleared as soon as you begin writing, but if you want to make it look a bit more "elegant", than you can check for errors anyway. Who knows -- it might be READ ERROR instead of FILE NOT FOUND.. [But if you DO check the error line, make sure that you IGNORE any FILE NOT FOUND errors it may return!] -- Bill Wisner / The Computer Connection I'm a very irrespon- UUCP: ..ihnp4!chinet!bdw sible person. I could CIS: 76474,1213 care less about the WOPR: "root" opinions expressed in USNail: 6290 Highway 44 the preceding message. Star, ID 83669 "In the beginning, God created the Apple ][ and the IBM PC. And God looked at the machines, and He saw that it was good." [The Hacker's Bible, 1:1]