From: alane AT wozzle DOT linet DOT org Subject: Truncating a file To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Thu, 29 Apr 1993 09:46:27 +0000 (EDT) > I've been investigating the trucate bug I posted on earlier, > and after looking through a description of the DOS system calls, > came to the conclusion that the only way you can truncate a file > is using FCB functions. Can anyone confirm that ? Uh, well, yes I can confirm that your information is incorrect. I _know_ this is gonna sound weird, BUT ... void trunc(int fd, long where) { fseek(fd,where,SEEK_SET); write(fd,(void*)0,0); } this little trick can make for interesting error conditions when otherwise healthy programs decide to write zero bytes to a file for some stupid reason :-) -- J. Alan Eldridge (alane AT wozzle DOT linet DOT org) (also on Fidonet: 1:272/38.473)