Packageflash.filesystem
Classpublic class FileMode
InheritanceFileMode Inheritance Object

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0

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 parameter value specified in the open method:

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

FileMode constantReadingWritingCreatingTruncate upon openingAppend written data
READ
WRITE
APPEND
UPDATE



Public Methods
 MethodDefined By
 Inherited
_init():*
[static]
_init
 Inherited
AS3
 Inherited
init():*
[static]
init
 Inherited
AS3
 Inherited
AS3
Protected Methods
 MethodDefined By
 Inherited
[static]
protected
 Inherited
_setPropertyIsEnumerable(o:*, V:String, enumerable:Boolean):void
[static]
protected
Public Constants
 ConstantDefined By
  AIR-only APPEND : String = "append"
[static] Used for a file to be opened in write mode, with all written data appended to the end of the file.
FileMode
 Inheritedlength : int = 1
[static]
length
  AIR-only READ : String = "read"
[static] Used for a file to be opened in read-only mode.
FileMode
  AIR-only UPDATE : String = "update"
[static] Used for a file to be opened in read/write mode.
FileMode
  AIR-only WRITE : String = "write"
[static] Used for a file to be opened in write-only mode.
FileMode
Constant Detail
AIR-only APPENDConstant
public static const APPEND:String = "append"

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0

Used for a file to be opened in write mode, with all written data appended to the end of the file. Upon opening, any nonexistent file is created.

AIR-only READConstant 
public static const READ:String = "read"

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0

Used for a file to be opened in read-only mode. The file must exist (missing files are not created).

AIR-only UPDATEConstant 
public static const UPDATE:String = "update"

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0

Used for a file to be opened in read/write mode. Upon opening, any nonexistent file is created.

AIR-only WRITEConstant 
public static const WRITE:String = "write"

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0

Used for a file to be opened in write-only mode. Upon opening, any nonexistent file is created, and any existing file is truncated (its data is deleted).