qdosmsq:traps:trap_3:trnc

FS_TRUNCATE/IOF_TRNC

This trap truncates a file to the current position.

Call ParametersReturn Parameters
D0.B$4BD0.LError return.
D1.L D1.LCorrupted.
D3.WTimeout D3.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.L A1.LCorrupted.

Any sub system IO errors including

ERR_NCNot complete.
  • All registers not shown above are not used on entry and are preserved on exit.

The example below shows the use of this trap call to truncate a file to the position set in D1.L. It is assumed that A0 contains the file's ID.

trnc    moveq   #fs_posab,d0    ; $42
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Set the position
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!
        moveq   #fs_truncate,d0 ; $4B
        trap    #3              ; Truncate
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!        
       
  • qdosmsq/traps/trap_3/trnc.txt
  • Last modified: 2009/05/27 16:59
  • by george.gwilt