qdosmsq:traps:trap_3:mkdir

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:mkdir [2010/10/30 14:34] (current)
george.gwilt created
Line 1: Line 1:
 +======  - /IOF_MKDR ======
 +This trap creates a directory.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$4D|D0.L|Error code.|
 +|D1.L|0|D1.L|Preserved.|
 +|D3.W|Timeout.|D3.L|Preserved.|
 +|A0.L|Channel ID.|A0.L|Preserved.|
 +
 +===== Errors =====
 +Any IOSS errors.
 +
 +
 +===== Notes =====
 +  * 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.
 +===== Example =====
 +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.
 +
 +<code>
 +        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'                    
 +</code>
  
  • qdosmsq/traps/trap_3/mkdir.txt
  • Last modified: 2010/10/30 14:34
  • by george.gwilt