delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/04/15:43:58

Date: Mon, 4 Aug 1997 15:43:27 -0400 (EDT)
From: "Art S. Kagel" <kagel AT ns1 DOT bloomberg DOT com>
To: Victor <fesenko AT pacific DOT net DOT sg>
Cc: djgpp AT delorie DOT com
Subject: Re: open() question
In-Reply-To: <33e1f561.1686433@news.pacific.net.sg>
Message-Id: <Pine.D-G.3.91.970804154146.11813G-100000@dg1>
Mime-Version: 1.0

On Fri, 1 Aug 1997, Victor wrote:

> I'm having a problem with open() function. As I understand using
> open("file.dat",O_RDWR|O_BINARY|O_CREAT)  a new file has to be created
> and if the file already existed, it would be rewritten. A problem
> shows when a file existed which had a bigger size than the file
> created. Then the file is rewritten, but it still shows the old size
> (which is bigger) and contains the remnants of an old file in the end.
> Other ways to solve this , e.g. using creat(), or using unlink()
> before open(), weren't successful as well.
> 
Check out the trunccate() function.

Art S. Kagel, kagel AT bloomberg DOT com

- Raw text -


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