4D v18

file.moveTo( )

Home

 
4D v18
file.moveTo( )

file.moveTo( )  


 

The file.moveTo( ) method moves or renames the File object into the specified destinationFolder

The destinationFolder must exist on disk, otherwise an error is generated.  

By default, the file retains its name when moved. If you want to rename the moved file, pass the new full name in the newName parameter. The new name must comply with naming rules (e.g., it must not contain characters such as ":", "/", etc.), otherwise an error is returned.

 

Returned object

The method returns the moved File object.

Example  

 $DocFolder:=Folder(fk documents folder)
 $myFile:=$DocFolder.file("Current/Infos.txt")
 $myFile.moveTo($DocFolder.folder("Archives");"Infos_old.txt")



See also 

folder.moveTo( )

 
PROPERTIES 

Product: 4D
Theme: File and Folder

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v18)