Move file

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO Windows,Linux

Syntax

Move file (from-pathto-pathReturns err-code

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command moves the file specified in from-path to the folder named in to-path. It returns an error code (See Error Codes), or zero if no error occurs. The to-path is the path to destination folder into which the file will be moved. The command may fail if the to-path directory contains a file with the same name as from-path filename.

Move file cannot move a file across volumes (disks). Use Copy file and Delete file instead. Move file cannot move directories.

Example

; Prompt the user for a file to move together with a path
; to move to and move the file
Do FileOps.$putfilename(lPathname,'Select a file for moving','') Returns lReturnFlag
If lReturnFlag
  Do FileOps.$selectdirectory(lNewPath,'Path to move to') Returns lReturnFlag
  If lReturnFlag
    Move file (lPathname,lNewPath) Returns lErrCode
  End If
End If