From: Alain Magloire Message-Id: <199907201418.KAA23375@mccoy2.ECE.McGill.CA> Subject: Re: ftruncate To: djgpp-workers AT delorie DOT com Date: Tue, 20 Jul 1999 10:18:41 -0400 (EDT) In-Reply-To: from "Eli Zaretskii" at Jul 20, 99 11:53:34 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Bonjour M. Eli Zaretskii > > An lseek()/write() will not do it, sometimes you want to create > > a "hole" in the file by lseek()ing pass the size not ftruncate()ed > > i.e. readjust its size. > > I think on DOS lseek followed by write does produce a hole like that. > On DOS, a write of zero bytes has the effect of adjusting the file's > size to the current byte position. I'm not sure I follow, so you are saying if I want to shrink a file, I can do that by lseek()ing back and write() 0 byte ? To do this on Un*x I got to use ftruncate(); -- au revoir, alain ---- Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!