
59
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Availability
Flash Media Server 2
File.close()
fileObject.close()
Closes the file. This method is called automatically on an open File object when the object is out of scope.
Availability
Flash Media Server 2
Returns
A boolean value indicating whether the file was closed successfully (true) or not (false). Returns false if the file is
not open.
Example
The following code closes the /path/file.txt file:
if (x.open("/path/file.txt", "read") ){
// Do something here.
x.close();
}
File.copyTo()
fileObject.copyTo(name)
Copies a file to a different location or copies it to the same location with a different filename. This method returns
false if the source file doesn't exist or if the source file is a directory. When this method fails, it invokes the
application.onStatus() event handler to report errors.
Note: The user or process owner that the server runs under in the operating system must have adequate write permissions
or the call can fail.
Availability
Flash Media Server 2
Parameters
name Specifies the name of the destination file. The name can contain only UTF-8 characters; high byte values can be
encoded by using the URI character-encoding scheme. The name specified is mapped to a system path by using the
mappings specified in the Application.xml file. If the path is invalid or if the destination file doesn’t exist, the operation
fails, and the method returns
false.
Returns
A boolean value indicating whether the file is copied successfully (true) or not (false).
Example
The following code copies the file set by the myFileObj File object to the location provided by the parameter:
Comentários a estes Manuais