Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!unido!tub!tubopal!alderaan From: alderaan@tubopal.UUCP (Thomas Cervera) Newsgroups: comp.sys.atari.st Subject: Re: Where is my Fshrink() GEMDOS call ? Message-ID: <638@opal.tubopal.UUCP> Date: 1 Aug 89 21:49:08 GMT References: <667@electro.UUCP> Reply-To: alderaan@tubopal.UUCP (Thomas Cervera) Organization: Technical University of Berlin, Germany Lines: 63 In article <667@electro.UUCP> ignac@electro.UUCP (Ignac Kolenko) writes: >In article <629@siena.tubopal.UUCP> alderaan@tubopal.UUCP (Thomas Cervera) writes: >> is there any problem adding a Fshrink(handle,newsize) GEMDOS call >>to the next GEMDOS release ? I think it's very frustrating to shrink files >>through a temporary file (the archiving program I'm writing has to do this >>while deleting files from archive). >> >why not just open the file for write, move the file pointer using >Fseek() and then close the file. that should do what you ask for. According to this little machine code I wrote for testing, this has absolutely NO effect to the tested file or to GEMDOS. .GEMDOS macro move.w #\1,-(SP) ; pass subfunction # trap #1 lea \2+2(SP),SP ; stack correction endm text ; Init & Mshrink () stuff FStest move.w #1,-(SP) ; open for write pea fn .GEMDOS $3D,6 ; Fopen () move.l D0,D1 ; store file handle tst.l D0 bmi error clr.w -(SP) ; seek from beginning of file move.w D1,-(SP) ; pass file handle move.l #1000,-(SP) ; skip 1000 bytes .GEMDOS $42,8 ; Fseek () tst.l D0 bmi error move.w D1,-(SP) ; pass file handle .GEMDOS $3E,2 ; Fclose () tst.l D0 bmi error mummy .GEMDOS 0,0 ; back to mum error ; display an error message bra mummy data fn 'globber.fil',0 ; file exists and has about 32k bss ... I did not upload this code, but it should be error-free :-) Or is it not ?! I used TOS 1.4 (GEMDOS V0.15). The file was a cached hard disk file (CACHEXXX). -- Thomas Cervera | UUCP: alderaan@tubopal.UUCP SysMan RKOpdp (RSTS/E) | alderaan%tubopal.UUCP@TUB.BITNET (saves $$$) D-1000 Berlin 30 | ...!pyramid!unido!tub!opal!alderaan Motzstrasze 14 | BITNET: alderaan%tub@DB0TUI11.BITNET