Package | flash.filesystem |
Class | public class FileMode |
Inheritance | FileMode ![]() |
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 constant | Reading | Writing | Creating | Truncate upon opening | Append written data |
---|---|---|---|---|---|
READ
| • | ||||
WRITE
| • | • | • | ||
APPEND
| • | • | • | ||
UPDATE
| • | • | • |
See also
Constant | Defined By | ||
---|---|---|---|
![]() [static]
Used for a file to be opened in write mode, with all written data appended to the end of the file. | FileMode | ||
![]() [static]
Used for a file to be opened in read-only mode. | FileMode | ||
![]() [static]
Used for a file to be opened in read/write mode. | FileMode | ||
![]() [static]
Used for a file to be opened in write-only mode. | FileMode |
![]() | Constant |
public static const APPEND:String = "append"
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.
![]() | Constant |
public static const READ:String = "read"
Used for a file to be opened in read-only mode. The file must exist (missing files are not created).
![]() | Constant |
public static const UPDATE:String = "update"
Used for a file to be opened in read/write mode. Upon opening, any nonexistent file is created.
![]() | Constant |
public static const WRITE:String = "write"
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).