truncating a file opened via open()

Ernest Hua hua at cmu-cs-edu1.ARPA
Fri Jun 7 16:49:39 AEST 1985


___________________________________________________________________________

Does anyone have any idea how to truncate a file at the current point in
writing if it is opened by open()?  I cannot use creat() because the file
is being used by another process, and I cannot use unlink() it is likely
that it is linked.  If the updated contents is longer than the original,
it is not a problem because the file length is just extended.  But if the
updated contents is shorter, the file does not shrink.  We have 4.1BSD on
several 780's and 750's.

Any help would be greatly appreciated.

ARPA:   (see below)
UUCP:   seismo!hua at cmu-cs-gandalf.arpa
CSNET:  hua%cmu-cs-gandalf.csnet at csnet.arpa
___________________________________________________________________________

Live long and prosper.
Keebler { hua at cmu-cs-gandalf.arpa }



More information about the Comp.unix.wizards mailing list