Gio.File.prototype.query_file_type

function query_file_type(flags: Gio.FileQueryInfoFlags, cancellable: Gio.Cancellable): Gio.FileType {
    // Gjs wrapper for g_file_query_file_type()
}
  

Utility function to inspect the Gio.FileType of a file. This is implemented using Gio.File.prototype.query_info and as such does blocking I/O.

The primary use case of this method is to check if a file is a regular file, directory, or symlink.

Since 2.18

flags

a set of Gio.FileQueryInfoFlags passed to Gio.File.prototype.query_info

cancellable

optional Gio.Cancellable object, null to ignore

Returns

The Gio.FileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist