Rename file

Purpose: Renames a file.

 rename-file <from file> to <to file> [ status <status> ]

rename-file will rename <from file> to <to file>. <status> number is GG_OKAY on success and GG_ERR_RENAME on failure.

<from file> and <to file> must be specified with full paths unless they are in the current working directory (see directories), in which case a name alone will suffice. <from file> and <to file> can be in different directories.
Examples
Rename files:
 rename-file "/home/u1/d1/f1" to "/home/u1/d2/f2" status st
 if-true st equal GG_OKAY
     @Rename successful. <br/>
 end-if

Rename files in the current working directory:
 rename-file "f1" to "f2" status st
 if-true st equal GG_OKAY
     @Rename successful. <br/>
 end-if

See also
Files
close-file  
copy-file  
delete-file  
file-position  
file-storage  
file-uploading  
lock-file  
open-file  
read-file  
read-line  
rename-file  
stat-file  
temporary-file  
uniq-file  
unlock-file  
write-file  
See all
documentation


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.