Module filesystem
File system and directory operation utilities.
Table of contents
Functions
| make_directory(path, cb) | Creates a directory at the given path. |
| iterate_contents(dir, iteratee, options[, cb="standard::type"]) | Iterates the contents of a directory. |
| list_contents(dir, attributes, cb) | Lists the contents of a directory. |
| remove_directory(dir, cb) | Recursively removes a directory and its contents. |
Functions
This only creates the child directory of the immediate parent of path. If the parent
directory doesn’t exist, this operation will fail.
Parameters:
-
path
-
cb
Callback parameters:
The iteratee callback is called once for every entry in the given directory, passing a
Gio.FileInfo as argument.
It’s callback argument only expects a single error parameter.
If options.recursive == true, iteration will recurse into subdirectories.
options.list_directories can be used to have iteratee not be called on directory entries.
On error, either within the iteration or passed by iteratee, iteration is aborted and
the final callback is called.
See file:query_info and g_file_query_info for
information on the attributes parameter.
Parameters:
-
dir : The directory to query contents for.
-
iteratee : The iterator function that will be called for each entry. The function will be called with a
Gio.FileInfoand a callback:function(info, cb). -
options
-
attributes : The attributes to query.
-
recursive : Recurse into directories.
-
list_directories : If
false, directories will not triggeriteratee.
-
-
cb
Callback parameters:
See file:query_info and g_file_query_info for
information on the attributes parameter.
Parameters:
-
dir : The directory to query contents for.
-
attributes : The attributes to query.
-
cb
Callback parameters:
-
-
A list of
Gio.FileInfos
Parameters:
-
dir : The directory to remove.
-
cb