
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
51
Read-only; for a directory, the number of files in the directory, not counting the current directory and parent
directory entries; for a file, the number of bytes in the file.
Availability
Flash Media Server 2
File.list()
fileObject.list(filter)
If the file is a directory, lists the files in the directory. Returns an array with an element for each file in the directory.
Availability
Flash Media Server 2
Parameters
filter A Function object that determines the files in the returned array.
If the function returns
true when a file’s name is passed to it as a parameter, the file is added to the array returned
by
File.list(). This parameter is optional and allows you to filter the results of the call.
Returns
An Array object.
Example
The following example returns files in the current directory that have 3-character names:
var a = x.currentDir.list(function(name){return name.length==3;});
File.mkdir()
fileObject.mkdir(newDir)
Creates a directory. The directory is created in the directory specified by fileObject. When this method fails, it
invokes the
application.onStatus() event handler to report errors.
The user or process owner that the server runs under in the operating system must have adequate write permissions
or the call can fail.
Note: You cannot call this method from a File object that is a file (where
isFile is true). You must call this method
from a File object that is a directory (where
isDirectory is true).
Availability
Flash Media Server 2
Parameters
newDir A string indicating the name of the new directory. This name is relative to the current File object instance.
Returns
A boolean value indicating success (
true) or failure (false).
Example
The following example creates a logs directory in the
myFileObject instance:
if (myFileObject.mkdir("logs")){
Commenti su questo manuale