Directory, v2.0.4

Lets you list directory contents and invoke JavaScript .callbacks for the contained items.

Other Versions

2.0.4, 2.0.2

BrowserPlus.Directory.list({params}, function{}())

Returns a list in "files" of filehandles resulting from a non-recursive traversal of the arguments. No directory structure information is returned.

Test: list()

Parameters

files: list
Paths to traverse.
followLinks: boolean (Optional)
If true, symbolic links will be followed. Default is true.
mimetypes: list (Optional)
Optional list of mimetype filters to apply (e.g.["image/jpeg"]
limit: integer (Optional)
Maximum number of items to examine. Default is 1000.
callback: callback (Optional)
Optional callback with will be invoked with each path.

BrowserPlus.Directory.recursiveList({params}, function{}())

Returns a list in "files" of filehandles resulting from a recursive traversal of the arguments. No directory structure information is returned.

Test: recursiveList()

Parameters

files: list
Paths to traverse.
followLinks: boolean (Optional)
If true, symbolic links will be followed. Default is true.
mimetypes: list (Optional)
Optional list of mimetype filters to apply (e.g.["image/jpeg"]
limit: integer (Optional)
Maximum number of items to examine. Default is 1000.
callback: callback (Optional)
Optional callback with will be invoked with each path.

BrowserPlus.Directory.recursiveListWithStructure({params}, function{}())

Returns a nested list in "files" of objects for each of the arguments. An "object" contains the keys "relativeName" (this node's name relative to the specified directory), "handle" (a filehandle for this node), and for directories "children" which contains a list of objects for each of the directory's children. Recurse into directories.

Test: recursiveListWithStructure()

Parameters

files: list
Paths to traverse.
followLinks: boolean (Optional)
If true, symbolic links will be followed. Default is true.
mimetypes: list (Optional)
Optional list of mimetype filters to apply (e.g.["image/jpeg"]
limit: integer (Optional)
Maximum number of items to examine. Default is 1000.
callback: callback (Optional)
Optional callback with will be invoked with each path.