Skip to Content
Using the HTML5 Filesystem API
book

Using the HTML5 Filesystem API

by Eric Bidelman
July 2011
Intermediate to advanced
72 pages
1h 13m
English
O'Reilly Media, Inc.
Content preview from Using the HTML5 Filesystem API

Chapter 5. Working with Directories

The DirectoryEntry

Directories in the sandboxed filesystem are represented by the DirectoryEntry interface. A DirectoryEntry contains many of the properties and methods found in FileEntry. Both inherit from a generic entry interface. However, it includes additional method for working with directories.

Properties

isFile

Boolean. True if the entry is a file.

isDirectory

Boolean. True if the entry is a directory.

name

DOMString. The name of the directory, excluding the path leading to it.

fullPath

DOMString. The full absolute path from the root to the directory.

filesystem

FileSystem. The filesystem on which the directory resides.

Methods

getMetadata (successCallback, opt_errorCallback)

Looks up metadata about this directory.

moveTo (parentDirEntry, opt_newName, opt_successCallback, opt_errorCallback)

Moves the directory to a different location on the filesystem.

copyTo (parentDirEntry, opt_newName, opt_successCallback, opt_errorCallback)

Copies the directory to a different parent on the filesystem. Directory copies are always recursive. It is an error to copy a directory inside itself or to copy it into its parent if a new name is not provided.

toURL ();

Returns a filesystem: URL that can be used to identify this directory. See Chapter 7.

remove (successCallback, opt_errorCallback)

Deletes a file or directory. It is an error to attempt to delete the root directory of a filesystem or a directory that is not empty.

getParent (successCallback, opt_errorCallback)

Returns the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Geolocation

HTML5 Geolocation

Anthony T. Holdener
HTML5 Hacks

HTML5 Hacks

Jesse Cravens, Jeff Burtoft
Grid Layout in CSS

Grid Layout in CSS

Eric A. Meyer

Publisher Resources

ISBN: 9781449311384Errata Page