Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!msuinfo!convex.cl.msu.edu!jap From: jap@convex.cl.msu.edu (Joe Porkka) Newsgroups: comp.sys.amiga.programmer Subject: Re: How do you truncate a file? Message-ID: <1991May6.145512.24786@msuinfo.cl.msu.edu> Date: 6 May 91 14:55:12 GMT References: <1991May5.063352.6627@csusac.csus.edu> Sender: news@msuinfo.cl.msu.edu Distribution: usa Organization: Michigan State University Lines: 17 dillon@overload.Berkeley.CA.US (Matthew Dillon) writes: >In article <1991May5.063352.6627@csusac.csus.edu> cilibrar@athena.ecs.csus.edu (Rudi Cilibrasi) writes: >>Suppose that I have a 100-byte file, and I want to get rid of the last >>ten bytes. Is there any way to do this other than freading in the > Under 2.0 there is a filesystem call, SetFileSize(), that will > truncate or extend a file as requested. Under 1.3 you have to > rewrite the file. The 1.3 FastFileSystem does support the truncate file packet, but there is no dos.library call for it. So if you are using 1.3FFS you can send a truncate packet to the filesystem directly. Check "pickpacket" (on a fish disk I think) for examples of how to send dos poackets.