Flash Media Server |
|||
| Server-Side ActionScript Language Reference > Server-Side ActionScript Language Reference > File class > File.renameTo() | |||
Flash Media Server 2.
fileObject.renameTo(name)
name The new name for the file or directory. The name can contain only UTF-8 encoded characters; high byte values can be encoded using the URI character-encoding scheme. The specified name is mapped to a system path using the mappings specified in the Application.xml file. If the path is invalid or the destination file doesn't exist, the operation will fail.
A Boolean value indicating whether the file was renamed or moved successfully (true) or not (false).
Method; moves or renames a file. The operation fails if the file is open or the directory points to the root directory.
The following code lets you execute code when myFileObject is renamed:
if (myFileObject.renameTo( "/logs/hello.log.old")){
// Do something here.
}