Dart API Referencedart:htmlDirectoryEntrySync

DirectoryEntrySync Interface

DRAFT
This page is not complete.

The DirectoryEntry interface of the FileSystem API represents a directory in a file system.

Extends

EntrySync

Methods

Code DirectoryReaderSync createReader() #

Creates a new DirectoryReader to read entries from this Directory.

void getMetada ();
Returns
DirectoryReader
DirectoryReaderSync createReader();

Code DirectoryEntrySync getDirectory(String path, Object flags) #

Creates or looks up a directory.

void vopyTo (
  (in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
);
Parameter
path
Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
options
  • If create and exclusive are both true, and the path already exists, getDirectory must fail.
  • If create is true, the path doesn't exist, and no other error occurs, getDirectory must create it as a zero-length file and return a corresponding getDirectory.
  • If create is not true and the path doesn't exist, getDirectory must fail.
  • If create is not true and the path exists, but is a directory, getDirectory must fail.
  • Otherwise, if no other error occurs, getFile must return a getDirectory corresponding to path.
successCallback
A callback that is called to return the DirectoryEntry selected or created.
errorCallback
A callback that is called when errors happen.
Returns
void
DirectoryEntrySync getDirectory(String path, Object flags);

Code FileEntrySync getFile(String path, Object flags) #

Creates or looks up a file.

void moveTo (
  (in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);
);
Parameter
path
Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
options
  • If create and exclusive are both true, and the path already exists, getFile must fail.
  • If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.
  • If create is not true and the path doesn't exist, getFile must fail.
  • If create is not true and the path exists, but is a directory, getFile must fail.
  • Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.
successCallback
A callback that is called to return the file selected or created.
errorCallback
A callback that is called when errors happen.
Returns
void
FileEntrySync getFile(String path, Object flags);

Code void removeRecursively() #

Deletes a directory and all of its contents, if any. If you are deleting a directory that contains a file that cannot be removed, some of the contents of the directory might be deleted. You cannot delete the root directory of a file system.

DOMString toURL (
  (in VoidCallback successCallback, optional ErrorCallback errorCallback);
);
Parameter
successCallback
A callback that is called to return the DirectoryEntry selected or created.
errorCallback
A callback that is called when errors happen.
Returns
void
void removeRecursively();

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.