User Guide
File class 81
Parameters
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.
Returns
A Boolean value indicating whether the file was renamed or moved successfully (true) or not
(
false).
Description
Method; moves or renames a file. The operation fails if the file is open or the directory points
to the root directory.
Example
The following code lets you execute code when myFileObject is renamed:
if (myFileObject.renameTo( "/logs/hello.log.old")){
// Do something here.
}
File.seek()
Availability
Flash Media Server 2.
Usage
fileObject.seek(numBytes)
Parameters
numBytes An integer indicating the number of bytes to move the file pointer from the
current position.
Returns
If the operation is successful, returns the current position in file; otherwise, returns -1. If the
file is closed, the operation fails and reports a warning. The operation returns
undefined if it’s
called on a directory.