delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/09/00:32:41

Date: Mon, 8 Sep 1997 21:30:25 -0700 (PDT)
Message-Id: <199709090430.VAA27722@adit.ap.net>
Mime-Version: 1.0
To: cbalciza AT mail DOT cccis DOT ro, djgpp AT delorie DOT com (djgpp mailing list)
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: file I/O (R/W) problem

At 10:48  9/8/1997 GMT, cbalciza AT mail DOT cccis DOT ro wrote:
>how can I open a file for both reading and writing without
>erasing the previous file content ?
I don't think rewriting a file in place works. The preferred method is to
write the new version to a temporary file, then replace the original with
it. A good example is the `utod' and `dtou' programs that come with DJGPP;
find their source in the library source zip.


Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019