qdosmsq:traps:trap_2:delete

IO_DELET/IOA_DELF

This trap allows a file to be deleted.

Call ParametersReturn Parameters
D0.B$04D0.LError code.
D1.LJob id of the job deleting the file.D1.LCorrupted.
D3.LUnusedD3.LCorrupted.
A0.LPointer to file name.A0.LCorrupted.
ERR_OMOut of memory.
ERR_NOChannel not open.
ERR_NFFile or device not found. (QDOS only, not SMSQ.)
ERR_BNBad file or device name.
  • All registers not shown above are not used on entry and are preserved on exit.
  • The job ID passed in D1.L can be -1 for 'the current job'.
  • SMSQ specifically checks for ERR_NF on return from this trap, and if found, clears D0. QDOS, will return ERR_NF if a file to be deleted is not found.

The following shows the use of this call to delete a file :

        moveq   #io_delet,d0      ; Trap code
        moveq   #-1,d1            ; This job will delete the file
        lea     name,a0           ; Pointer to the filename
        trap    #2                ; Delete the file
        tst.l   d0                ; Test for errors
        bne.s   error             ; The deletion has failed.

        ; Carry on here - the deletion worked.

name    dc.w    14                ; Length of filename
        dc.b    'FLP1_scrap_txt'  ; Bytes of actual filename
  • qdosmsq/traps/trap_2/delete.txt
  • Last modified: 2021/04/30 16:24
  • by normandunbar