Methods
(static) createDirectory(opt)
Creates a directory, after checking storage permissions. This operation is asynchronous.
Parameters:
Name |
Type |
Description |
opt |
Object
|
Properties
Name |
Type |
Attributes |
Description |
file |
Titanium.Filesystem.File
|
|
The file object that identifies the directory to create. |
success |
function
|
<optional>
|
The callback to invoke on success. |
error |
function
|
<optional>
|
The callback to invoke on error. |
|
- Source:
- See:
-
(static) deleteDirectory(opt)
Deletes a directory, after checking storage permissions. This operation is asynchronous.
Parameters:
Name |
Type |
Description |
opt |
Object
|
Properties
Name |
Type |
Attributes |
Description |
file |
Titanium.Filesystem.File
|
|
The file object that identifies the directory to delete. |
success |
function
|
<optional>
|
The callback to invoke on success. |
error |
function
|
<optional>
|
The callback to invoke on error. |
recursive |
Boolean
|
<optional>
|
Pass true to recursively delete any directory contents. |
|
- Source:
- See:
-
(static) getSize(path) → {Number}
Get the size of a directory in bytes
Parameters:
Name |
Type |
Description |
path |
String
|
|
- Source:
Returns:
-
Type
-
Number
(static) listDirectoryRecursive(path)
Lists the content of a directory and all its subdirectories.
Returns a list of objects with the structure `{path: "", content: []}`
Returns `null` if the specified path does not point to an existing directory.
Parameters:
Name |
Type |
Description |
path |
String
|
|
- Source:
(static) move(src, dest, ow) → {Boolean}
Move a file or a directory to a new path. Overwrite the destination path if the flag is set to true.
Returns true if the operation was successful.
Parameters:
Name |
Type |
Description |
src |
String
|
the path of the file/directory to move |
dest |
String
|
the destination path |
ow |
Boolean
|
set to true to overwrite destination path |
- Source:
Returns:
-
Type
-
Boolean
(static) write(opt)
Writes the specified data to a file, after checking storage permissions. This operation is asynchronous.
Parameters:
Name |
Type |
Description |
opt |
Object
|
Properties
Name |
Type |
Attributes |
Description |
file |
Titanium.Filesystem.File
|
|
The file to modify |
data |
String/Titanium.Filesystem.File/Titanium.Blob
|
|
Data to write, as a String, Blob or File object. |
success |
function
|
<optional>
|
The callback to invoke on success. |
error |
function
|
<optional>
|
The callback to invoke on error. |
append |
Boolean
|
<optional>
|
If true, append the data to the end of the file. |
|
- Source:
- See:
-