truncating a file opened via open()

Steven List steven at luke.UUCP
Fri Jun 14 05:30:08 AEST 1985


In article <786 at turtlevax.UUCP> ken at turtlevax.UUCP (Ken Turkowski) writes:
>In article <340 at cmu-cs-edu1.ARPA> hua at cmu-cs-edu1.ARPA (Ernest Hua) writes:
>>Does anyone have any idea how to truncate a file at the current point in
>>writing if it is opened by open()?
>
>size = lseek(fd, 0L, 1);	/* tell(fd) */
>ftruncate(fd, size);		/* int fd, size; */
>
>It's yet another undocumented feature on 4.2.

OK, how about System III?  That's my problem.  Someone out there posted
a program that uses ftruncate, and we don't have it.  Solutions are
welcome!
-- 
***
*  Steven List @ Benetics Corporation  *  (415) 940-6300
*  {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!steven
***



More information about the Comp.unix.wizards mailing list