FS_RENAME/IOF_RENAM
This trap renames a file.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.B | $4A | D0.L | Error return. |
D1.L | D1.L | Corrupted. | |
D3.W | Timeout | D3.L | Preserved. |
A0.L | Channel ID | A0.L | Preserved. |
A1.L | Pointer to new filename | A1.L | Corrupted. |
Errors
Any IO sub system errors including
ERR_NC | Not complete. |
Notes
- 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.
Example
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