Gio.File.prototype.make_directory_with_parents

function make_directory_with_parents(cancellable: Gio.Cancellable): Boolean {
    // Gjs wrapper for g_file_make_directory_with_parents()
}
  

Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this function will fail, setting @error to Gio.IOErrorEnum.not_supported. If the directory itself already exists, this function will fail setting @error to Gio.IOErrorEnum.exists, unlike the similar GLib.mkdir_with_parents.

For a local Gio.File the newly created directories will have the default (current) ownership and permissions of the current process.

If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.cancelled will be returned.

Since 2.18

cancellable

optional Gio.Cancellable object, null to ignore

Returns

true if all directories have been successfully created, false otherwise.