window.runtime property | window.runtime.flash.filesystem.FileMode |
Inheritance | FileMode Object |
Runtime Versions: | 1.0 |
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:
- Reading—The FileStream object can read data from the file.
- Writing—The FileStream object can write data to the file.
- Creating—The FileStream object creates a nonexistent file upon opening.
- Truncate upon opening—Data in the file is deleted upon opening (before any data is written).
- Append written data—Data is always written to the end of the file (when any write method is called).
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 constant | Reading | Writing | Creating | Truncate upon opening | Append written data |
---|---|---|---|---|---|
READ
| • | ||||
WRITE
| • | • | • | ||
APPEND
| • | • | • | ||
UPDATE
| • | • | • |
See also
Constant | Defined By | ||
---|---|---|---|
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 | ||
READ : String = "read" [static]
Used for a file to be opened in read-only mode. | FileMode | ||
UPDATE : String = "update" [static]
Used for a file to be opened in read/write mode. | FileMode | ||
WRITE : String = "write" [static]
Used for a file to be opened in write-only mode. | FileMode |
APPEND | Constant |
public static const APPEND:String = "append"
Runtime Versions: | 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.
READ | Constant |
public static const READ:String = "read"
Runtime Versions: | 1.0 |
Used for a file to be opened in read-only mode. The file must exist (missing files are not created).
UPDATE | Constant |
public static const UPDATE:String = "update"
Runtime Versions: | 1.0 |
Used for a file to be opened in read/write mode. Upon opening, any nonexistent file is created.
WRITE | Constant |
public static const WRITE:String = "write"
Runtime Versions: | 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).
Thu Sep 29 2011, 02:34 AM -07:00