Adobe Flex 2 Language Reference - collected by Jimbob | Back to MY RESOURCES


Packageflash.filesystem
Classpublic class FileMode
InheritanceFileMode Inheritance Object

The FileMode class defines string constants used in the fileMode parameter of the open() and openAsync() methods of the FileStream class. The fileMode parameter of these methods determines the capabilities available to the FileStream object once the file is opened.

The following capabilities are available, in various combinations, based on the fileMode specified in the open method:

The following table shows the capabilities each constant in the FileMode class provides when applied as the fileMode parameter of an open method of a FileStream object:

FileMode constant Reading Writing Creating Truncate upon opening Append written data
READ
WRITE
APPEND
UPDATE

See also

FileStream.open()
FileStream.openAsync()


Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined by
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined by
  APPEND : String = "append"
[static] The file is opened in write mode, with all written data appended to the end of the file.
FileMode
  READ : String = "read"
[static] The file is opened in read-only mode.
FileMode
  UPDATE : String = "update"
[static] The file is opened in read/write mode.
FileMode
  WRITE : String = "write"
[static] The file is opened in write-only mode.
FileMode
Constant detail
APPENDconstant
public static const APPEND:String = "append"

The file is opened in write mode, with all written data appended to the end of the file. Upon opening, any non-existent file is created.

READconstant 
public static const READ:String = "read"

The file is opened in read-only mode. The file must exist (missing files are not created).

UPDATEconstant 
public static const UPDATE:String = "update"

The file is opened in read/write mode. Upon opening, any non-existent file is created.

WRITEconstant 
public static const WRITE:String = "write"

The file is opened in write-only mode. Upon opening, any non-existent file is created, and any existing file is truncated (its data is deleted).






collected by Jimbob 2007.05