From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Partial file overwrite Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <8u89ok$r75$1 AT nnrp1 DOT deja DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 19 X-Trace: /wObnZukujrfF84GFgXDwFfJ/5hewUMb5HMlG+UG3zjsnpaS8xzaiXX50setFsissxitbp8Dzz6S!Xn3nvW81xfc/uaue7DQDSCHfNsS6hiX7LqGHjeNyPDVlUCnk2uYUdh+SV+/boeXj9Qgl/JMocqWj!CXCG+w== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Tue, 07 Nov 2000 15:01:49 GMT Distribution: world Date: Tue, 07 Nov 2000 15:01:49 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 07 Nov 2000 07:08:07 GMT, stryyker AT my-deja DOT com wrote: >how do I overwrite a part of a binary file without disturbing the rest? >I don't want to create a temp file then delete/rename. Do what Eli said. But a word of caution: If you're trying to write the user's document on a "save" command, you must use a temp file with delete/rename; otherwise, if the computer crashes or the mains die while you're writing the data, the user's precious data is irretrievably lost (lawsuit!). Yes, I'm just bitter that GIMP for Windows has eaten some of my files. --