Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cmu-cs-edu1.ARPA Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!bellcore!decvax!genrad!panda!talcott!harvard!seismo!rochester!cmu-cs-pt!cmu-cs-edu1!hua From: hua@cmu-cs-edu1.ARPA (Ernest Hua) Newsgroups: net.unix-wizards Subject: truncating a file opened via open() Message-ID: <340@cmu-cs-edu1.ARPA> Date: Fri, 7-Jun-85 02:49:39 EDT Article-I.D.: cmu-cs-e.340 Posted: Fri Jun 7 02:49:39 1985 Date-Received: Sun, 9-Jun-85 03:04:03 EDT Organization: Carnegie-Mellon University, CS/RI Lines: 19 ___________________________________________________________________________ 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@cmu-cs-gandalf.arpa CSNET: hua%cmu-cs-gandalf.csnet@csnet.arpa ___________________________________________________________________________ Live long and prosper. Keebler { hua@cmu-cs-gandalf.arpa }