QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools



This trap renames a file.

Call ParametersReturn Parameters
D0.B$4AD0.LError return.
D1.L D1.LCorrupted.
D3.WTimeout D3.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LPointer to new filenameA1.LCorrupted.


Any IO sub system errors including

ERR_NCNot complete.


  • All registers not shown above are not used on entry and are preserved on exit.
  • The name to which A1.L points should be a QDOS string, length followed by the byte characters. The name should include the device.
  • This trap does not work on all devices. In particular it does not work on MDV and DOS.
  • The channel ID in A0 must, obviously, have been opened so that the file can be written to as well as read from. The possible values of D3 in the open routine are thus 0 (OPEN), 2 (OPEN_NEW) and 3 (OPEN_OVER). Any other value would prevent a new name from being set. However, although a file opened to the RAM device with any of values 0, 2 and 3 can have its name altered, other devices require that the open be of type 0 (OPEN). In particular FLP and WIN require this.


The example below shows the use of this trap call. It is assumed that an appropriate ID is set in A0.L.

renm    moveq   #fs_rename,d0     ; $4A
        moveq   #-1,d3          ; Timeout
        lea     name,a1         ; New name
        trap    #3              ; Do it
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!

name    dc.w    name_e-*-2
        dc.b    "win1_new_name"
name_e  ds.b    0              
qdosmsq/traps/trap_3/rnam.txt · Last modified: 2009/05/27 14:39 by george.gwilt