Copies the entire folder's heirarchy folder from one location to another. If the other location doesn't exists, it will be constructed.
The source folder
The destination folder (get's created if not exist)
Recursively empties a folder of all it's contents (and all the sub-folder's contents), but leaves the source folder.
The source folder
Prevents actual deletion, but still allows the return list to display what "will" be deleted.
An array containing a list of paths to files and folders that we're deleted (or will be deleted when dryrun is true)
Checks to see if a folder exists.
The path to the folder.
duh duh
Creates a folder at the specified location. The sub-folder heirarchy is
constructed as needed.
For example if a folder exists here:
/path/to/folder
… but the following sub-folders don't exists:
/path/to/folder/sub/one/two/three
… Then the "sub/one/two/three" tree will be constructed inside "/path/to/folder")
The destination folder to create
Read a folder and returns an object containing all of the files and
folder in arrays.
The path to the folder to read.
A custom filter funciton.
Should we retrieve sub-folders too?
Used internally to store recursive findings.
Note that you may also provide this argument and readdir will populate your
existing files/folder list. But is recommended to leave this argument alone.
An object containing a list of "files" and "folders"
(as properties of the returned list), where each is an array.
var contents = readdir("/path/to/folder", null, true);
// yeids contents {
// files : [
// "/path/to/folder/1.foo",
// "/path/to/folder/2.bar",
// "/path/to/folder/3.png",
// "/path/to/folder/sub1/1.foo",
// "/path/to/folder/sub2/2.bar",
// "/path/to/folder/sub3/3.png"
// ],
// dirs : [
// "/path/to/folder/sub1",
// "/path/to/folder/sub2",
// "/path/to/folder/sub3"
//
// ]
// }
Collects files from a folder based on the specified extension (or
extensions). Can be used to search recursively through all sub-folders, and can
search multiple extensions.
Provided as shortcut for readdir with your own
extension-checking filter.
The path to search
The extension to look for (e.g. "jpg"). To
search for multiple extensions, use an array e.g. ["jpg", "png", "gif"]
Find all matching files in all
sub-folders.
The resulting array contains only files that mathc the
specified extension(s).
Recursively removes a folder and all of it's sub-folders as well.
The path to the folder
Prevents actual deletion, but still allows the return to return the list of items that "will" be deleted.
An array of all the items that were deleted (or "will be" deleted if dryrun is true.