HTML and CSS Reference
In-Depth Information
File API
Listing 3.12. app.jsā€”Loading files in the File Editor view
Table3.1 reviews the behavior of the File System API method getFile when passed dif-
ferent values of the options object. The object consists of two Boolean fields. The first,
create , determines if getFile should try to create a new FileEntry object (cre-
ate:true) or retrieve an existing FileEntry object (create:false) . The second
field, exclusive , determines if getFile should check for the existence of a FileEntry
object with the same file path name as getFile 's filename argument (exclus-
ive:true) .
Table 3.1. A list of getFile 's responses to various configurations of the options argument [ a ]
a .
FileEntry state
options object
getFile response
FileEntry found at given file path name
create: false exclusive ignored
FileEntry is returned
create: true exclusive: true
Error is thrown
FileEntry found at given file path name, but the
FileEntry is a directory
create: false exclusive ignored
Error is thrown
Search WWH ::

Custom Search