DOS Fn 56H: Rename/Move a File
Expects: AH 56H
DS:DX address of ASCIIZ▲ string szOldName (existing file)
ES:DI address of ASCIIZ string szNewName (desired path\filespec)
Returns: AX error code if CF is set to CY
Info: Renames a file or moves a file or directory to a different
directory on the same disk.
DS:DX and ES:DI point to an ASCIIZ strings in the form...
If the drive or path is omitted, defaults are assumed.
The szOldName must exist and must not contain wildcards▲. The
drive and path are optional; if omitted, defaults are used.
The szNewName must NOT exist. If a drive ID is used, then it
must match that of the szOldName. If drive or path are omitted,
current defaults will be assumed.
If szOldName and szNewName contain different paths (explicitly or
as assumed by defaults) then the file entry will be MOVED to the
directory named in the szNewName.
Notes: ■ You can use this function to rename, but not move, a directory;
that is, the path part of szNewName must be explicitly the same
as the path part of szOldName.
■ You cannot use this to move between drives (that's a copy
operation which must be performed in multiple steps).
■ You can rename files and directories on a network drive only if
you have write permission on the network drive.
■ For files, the szOldName must not be open by any process.
See Also: Directory and File Functions