Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.190.251.MISMATCH!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail From: ruben safir Newsgroups: comp.os.linux.development.apps Subject: Re: reading a temp file in C++ Date: Thu, 30 Jun 2011 03:06:59 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 16 Message-ID: References: <96uungF471U1@mid.uni-berlin.de> NNTP-Posting-Host: www2.mrbrklyn.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1309403219 18670 96.57.23.82 (30 Jun 2011 03:06:59 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 30 Jun 2011 03:06:59 +0000 (UTC) User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT b9bcc95 master) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:172 On Tue, 28 Jun 2011 21:17:36 +0000, Jens Thoms Toerring wrote: > It may even "delete" (unlink()) the old file, the file descriptor in the > program that invoked vi (or any other editor) using system() > will still be valid - while the original file then has no name in the > file system anymore ot still exists (via its inodes(s)) until nothing > uses it anymore and it only then finally gets removed com- pletely. No - the problem seems to have been that i couldn't open the file with the file descriptor using binary or ios::add mode. It needed to be opened as ios.in and ios.out. Then everything was fine. Ruben