GN_Mov, Move a file

Register parameters

RST 20H, DEFW $8A09
IN: A   = reason code
          CM_TODIR  = $00, move file to a directory (keeping same filename)
          CM_TOFILE = $01, move file as new filename in optional different directory
    BHL = pointer to null-terminated source filename (B=0, local)
    CDE = pointer to a null-terminated destination directory or filename (C=0, local)
out, if successful:
        Fc = 0, file successfully moved
out, if failed:
        Fc = 1, unable to move file
        A = error code:
             RC_IVF, Invalid directory path name
             RC_USE, File in use
             RC_EXIS, File already exists
   registers changed after return:
        A.BCDEHL/IXIY  same
        .F....../....  different


  • API call implemented in OZ 5.0
  • If TODIR option is set, the destination path must be an existing directory.
  • If TOFILE option is set, source file (or directory) is renamed to target name. This name should be verified not to be already existing before.
  • This call is fast when files are on the same device because only file header (node) is moved.
  • When files are moved accross devices then a file copying followed by a file deletion are performed.

Related calls

GN_Cl, close file 
GN_Del, delete a file from memory
GN_Opf, open file/resource (wildcard search)
GN_Ren, rename file
GN_Cpy, copy file
OS_Fdp, fast sector-level duplicate of source file to target file 
OS_Cl, internal close (OZ usage) 
OS_Del, file delete (internal OZ usage) 
OS_Frm, file read miscellaneous 
OS_Fwm, file write miscellaneous 
OS_Gb, get byte from file (or device) 
OS_Gbt, get byte from file (or device) with timeout 
OS_Mv, move bytes between stream and memory 
OS_Op, internal open (OZ usage) 
OS_Pb, write byte to file, device 
OS_Pbt, write byte to file, device with timeout 
OS_Ren, file rename (internal OZ usage)

web analytics