Table of Contents
Note: This API call is for DOS and Win16 personality only. Use Family API for portability.
Int 21H, AH=56H
Version
2 and higher
Brief
“RENAME” - RENAME FILE
Family API
Input
AH = 56h DS:DX -> ASCIZ filename of existing file (no wildcards, but see below) ES:DI -> ASCIZ new filename (no wildcards) CL = attribute mask (server call only, see below)
Return
CF clear if successful CF set on error AX = error code (02h,03h,05h,11h) (see #01680)
Notes
allows move between directories on same logical volume
this function does not set the archive attribute (see #01420 at AX=4301h), which results in incremental backups not backing up the file under its new name
open files should not be renamed
(DOS 2.x only) this function renames file by creating a new directory entry with the new name, then marking the old entry deleted
(DOS 3.0+) allows renaming of directories
(DOS 3.1+) wildcards are allowed if invoked via AX=5D00h, in which case error 12h (no more files) is returned on success, and both source and destination specs must be canonical (as returned by AH=60h). Wildcards in the destination are replaced by the corresponding char of each source file being renamed. Under DOS 3.x, the call will fail if the destination wildcard is *.* or equivalent; under DR DOS 5.0, the call will fail with error code 03h if any wildcards are used. When invoked via AX=5D00h, only those files matching the attribute mask in CL are renamed.
under the FlashTek X-32 DOS extender, the old-name pointer is in DS:EDX and the new-name pointer is in ES:EDI (DS must equal ES)
BUG: (DR DOS 3.41) when invoked via AX=5D00h, this function will generate a new directory entry with the new name (including any wildcards) which can only be removed with a sector editor
See also
Note
Text based on Ralf Brown Interrupt List Release 61
osFree Macro Library | |
---|---|
Video I/O | @SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls |
Hardware info | @Equipment @MemSize |
Serial I/O | @AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus |
Tape I/O | @TapeOn @TapeOff @TapeRead @TapeWrite |
Keyboard I/O | @KbdStatus @CharIn @CharPeek |
Printer I/O | @PrnPrint @PrnInit @PrnStatus |
Disk I/O | @DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat |
Date and Time | @SetTime @GetTime |
Mouse | @MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion |
Memory manager | @ModBlok SET_BLOCK |