11.1 air File System Overview

Source: Internet
Author: User

Air File System Overview

Adobe AIR provides a variety of classes to support access, create and manage files and their directories. These classes are included in the Flash. filesystem package, as follows:

File

A file object represents the path of a file or directory.

Filemode

The filemode class defines some string constants used as the open () and openasync () method parameters of the filestream class. These parameters determine the file operation mode opened by the filestream object, such as writing, reading, appending, or updating.

Filestream

The filestream object is used to open files and read and write files. Once a file object reference is created, it must be passed to the filestream object for open or data operations.

Some methods of the file class are both synchronous and asynchronous:

File. copyto () and file. copytoasync ()

File. deletedirectory () and file. deletedirectoryasync ()

File. deletefile () and file. deletefileasync ()

File. getdirectorylisting () and file. getdirectorylistingasync ()

File. moveTo () and file. movetoasync ()

File. movetotrash () and file. movetotrashasync ()

Correspondingly, whether the filestream operation method is asynchronous depends on the method in which the filestream object opens the file: whether to call the open () or openasync () method.

The Asynchronous Method enables the process to run in the background. when the process is completed, the corresponding Event Notification is triggered. When an asynchronous process is executed, other code can be executed, and the synchronization method must set the addeventlistener () method of the listener, such as file or filestream.

The synchronization method is simpler. You only need to set the listener for processing, but the background process is not completed and the program will remain in the waiting state. This is especially bad for display rendering or animation, it seems that there is no response.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.