qdosmsq:traps:trap_3:mkdir

- /IOF_MKDR

This trap creates a directory.

Call ParametersReturn Parameters
D0.B$4DD0.LError code.
D1.L0D1.LPreserved.
D3.WTimeout.D3.LPreserved.
A0.LChannel ID.A0.LPreserved.

Any IOSS errors.

  • All registers not shown above are not used on entry and are preserved on exit.
  • The timeout in D3.W should be -1.
  • The file whose ID is in A0 must have been opened by access codes 0, 2 or 3 which are OPEN, OPEN_NEW and OPEN_OVER.
  • The file must be empty.
  • On a successful exit the trap will have set the access code of the file to 4, which is DIRECTORY.

The example below shows the use of this trap call to create a directory WIN1_THINGS. It will only work if there is no existing file of that name.

        lea     flnme,a0        ; File name
        moveq   #IO_OPEN,d0     ; $01
        moveq   #-1,d1          ; This job
        moveq   #2,d3           ; OPEN_NEW           
        trap    #2              ; Open file and set ID in A0
        tst.l   d0              ; OK? . .
        bne.s   oops    --->    ; . . NO!
        moveq   #$4D,d0         ; IOF_MKDR
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Do it
        tst.l   d0              ; OK? . .
        bne.s   oops    ---->   ; . . NO!
        moveq   #IO_CLOSE,d0    ; $02
        trap    #2              ; Close the file   
        ...

flnme   dc.w    11
        dc.b    'WIN1_THINGS'                    
  • qdosmsq/traps/trap_3/mkdir.txt
  • Last modified: 2010/10/30 15:34
  • by george.gwilt