Gio.File.prototype.get_parent

function get_parent(): Gio.File {
    // Gjs wrapper for g_file_get_parent()
}
  

Gets the parent directory for the file. If the file represents the root directory of the file system, then null will be returned.

This call does no blocking I/O.

Returns

a Gio.File structure to the parent of the given Gio.File or null if there is no parent. Free the returned object with GObject.Object.prototype.unref.