gio.global

Global functions for gio2 library

fn busGet busGetFinish busGetSync busOwnName busOwnNameOnConnection busUnownName busUnwatchName busWatchName busWatchNameOnConnection contentTypeCanBeExecutable contentTypeEquals contentTypeFromMimeType contentTypeGetDescription contentTypeGetGenericIconName contentTypeGetIcon contentTypeGetMimeDirs contentTypeGetMimeType contentTypeGetSymbolicIcon contentTypeGuess contentTypeGuessForTree contentTypeIsA contentTypeIsMimeType contentTypeIsUnknown contentTypeSetMimeDirs contentTypesGetRegistered dbusAddressEscapeValue dbusAddressGetForBusSync dbusAddressGetStream dbusAddressGetStreamFinish dbusAddressGetStreamSync dbusEscapeObjectPath dbusEscapeObjectPathBytestring dbusGenerateGuid dbusGvalueToGvariant dbusGvariantToGvalue dbusIsAddress dbusIsErrorName dbusIsGuid dbusIsInterfaceName dbusIsMemberName dbusIsName dbusIsSupportedAddress dbusIsUniqueName dbusUnescapeObjectPath ioErrorFromErrno ioErrorFromFileError ioErrorQuark ioModulesScanAllInDirectory ioModulesScanAllInDirectoryWithScope ioSchedulerCancelAllJobs ioSchedulerPushJob keyfileSettingsBackendNew memorySettingsBackendNew networkingInit nullSettingsBackendNew pollableSourceNew pollableSourceNewFull pollableStreamRead pollableStreamWrite pollableStreamWriteAll resourcesEnumerateChildren resourcesGetInfo resourcesLookupData resourcesOpenStream resourcesRegister resourcesUnregister simpleAsyncReportGerrorInIdle unixIsMountPathSystemInternal unixIsSystemDevicePath unixIsSystemFsType unixMountAt unixMountCompare unixMountCopy unixMountFor unixMountFree unixMountGetDevicePath unixMountGetFsType unixMountGetMountPath unixMountGetOptions unixMountGetRootPath unixMountGuessCanEject unixMountGuessIcon unixMountGuessName unixMountGuessShouldDisplay unixMountGuessSymbolicIcon unixMountIsReadonly unixMountIsSystemInternal unixMountPointsChangedSince unixMountPointsGet unixMountsChangedSince unixMountsGet

Functions 91

fnvoid busGet(gio.types.BusType busType, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Asynchronously connects to the message bus specified by bus_type.
fngio.dbus_connection.DBusConnection busGetFinish(gio.async_result.AsyncResult res)Finishes an operation started with [gio.global.busGet].
fngio.dbus_connection.DBusConnection busGetSync(gio.types.BusType busType, gio.cancellable.Cancellable cancellable = null)Synchronously connects to the message bus specified by bustype. Note that the returned object may shared with other callers, e.g. if two separate parts of a process calls this function with the sam...
fnuint busOwnNameOnConnection(gio.dbus_connection.DBusConnection connection, string name, gio.types.BusNameOwnerFlags flags, gobject.closure.Closure nameAcquiredClosure = null, gobject.closure.Closure nameLostClosure = null)Version of [gio.global.busOwnNameOnConnection] using closures instead of callbacks for easier binding in other languages.
fnuint busOwnName(gio.types.BusType busType, string name, gio.types.BusNameOwnerFlags flags, gobject.closure.Closure busAcquiredClosure = null, gobject.closure.Closure nameAcquiredClosure = null, gobject.closure.Closure nameLostClosure = null)Version of [gio.global.busOwnName] using closures instead of callbacks for easier binding in other languages.
fnvoid busUnownName(uint ownerId)Stops owning a name.
fnvoid busUnwatchName(uint watcherId)Stops watching a name.
fnuint busWatchNameOnConnection(gio.dbus_connection.DBusConnection connection, string name, gio.types.BusNameWatcherFlags flags, gobject.closure.Closure nameAppearedClosure = null, gobject.closure.Closure nameVanishedClosure = null)Version of [gio.global.busWatchNameOnConnection] using closures instead of callbacks for easier binding in other languages.
fnuint busWatchName(gio.types.BusType busType, string name, gio.types.BusNameWatcherFlags flags, gobject.closure.Closure nameAppearedClosure = null, gobject.closure.Closure nameVanishedClosure = null)Version of [gio.global.busWatchName] using closures instead of callbacks for easier binding in other languages.
fnbool contentTypeCanBeExecutable(string type)Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).
fnbool contentTypeEquals(string type1, string type2)Compares two content types for equality.
fnstring contentTypeFromMimeType(string mimeType)Tries to find a content type based on the mime type name.
fnstring contentTypeGetDescription(string type)Gets the human readable description of the content type.
fnstring contentTypeGetGenericIconName(string type)Gets the generic icon name for a content type.
fngio.icon.Icon contentTypeGetIcon(string type)Gets the icon for a content type.
fnstring[] contentTypeGetMimeDirs()Get the list of directories which MIME data is loaded from. See [gio.global.contentTypeSetMimeDirs] for details. Returns: null-terminated list of directories to load MIME data from, including any `...
fnstring contentTypeGetMimeType(string type)Gets the mime type for the content type, if one is registered.
fngio.icon.Icon contentTypeGetSymbolicIcon(string type)Gets the symbolic icon for a content type.
fnstring contentTypeGuess(string filename, ubyte[] data, out bool resultUncertain)Guesses the content type based on example data. If the function is uncertain, result_uncertain will be set to true. Either filename or data may be null, in which case the guess will be based solely...
fnstring[] contentTypeGuessForTree(gio.file.File root)Tries to guess the type of the tree with root root, by looking at the files it contains. The result is an array of content types, with the best guess coming first.
fnbool contentTypeIsA(string type, string supertype)Determines if type is a subset of supertype.
fnbool contentTypeIsMimeType(string type, string mimeType)Determines if type is a subset of mime_type. Convenience wrapper around [gio.global.contentTypeIsA].
fnbool contentTypeIsUnknown(string type)Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream.
fnvoid contentTypeSetMimeDirs(string[] dirs = null)Set the list of directories used by GIO to load the MIME database. If dirs is null, the directories used are the default:
fnstring[] contentTypesGetRegistered()Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using `glistfreefull (list, gfree)`. Returns: list of the registered co...
fnstring dbusAddressEscapeValue(string string_)Escape string so it can appear in a D-Bus address as the value part of a key-value pair.
fnstring dbusAddressGetForBusSync(gio.types.BusType busType, gio.cancellable.Cancellable cancellable = null)Synchronously looks up the D-Bus address for the well-known message bus instance specified by bus_type. This may involve using various platform specific mechanisms.
fnvoid dbusAddressGetStream(string address, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Asynchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. address must be in the [D...
fngio.iostream.IOStream dbusAddressGetStreamFinish(gio.async_result.AsyncResult res, out string outGuid)Finishes an operation started with [gio.global.dbusAddressGetStream].
fngio.iostream.IOStream dbusAddressGetStreamSync(string address, out string outGuid, gio.cancellable.Cancellable cancellable = null)Synchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. address must be in the [D-...
fnstring dbusEscapeObjectPath(string s)This is a language binding friendly version of [gio.global.dbusEscapeObjectPathBytestring].
fnstring dbusEscapeObjectPathBytestring(ubyte[] bytes)Escapes bytes for use in a D-Bus object path component. bytes is an array of zero or more nonzero bytes in an unspecified encoding, followed by a single zero byte.
fnstring dbusGenerateGuid()Generate a D-Bus GUID that can be used with e.g. [gio.dbusconnection.DBusConnection.new].
fnglib.variant.Variant dbusGvalueToGvariant(gobject.value.Value gvalue, glib.variant_type.VariantType type)Converts a #GValue to a #GVariant of the type indicated by the type parameter.
fnvoid dbusGvariantToGvalue(glib.variant.Variant value, out gobject.value.Value outGvalue)Converts a #GVariant to a #GValue. If value is floating, it is consumed.
fnbool dbusIsAddress(string string_)Checks if string is a [D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
fnbool dbusIsErrorName(string string_)Check whether string is a valid D-Bus error name.
fnbool dbusIsGuid(string string_)Checks if string is a D-Bus GUID.
fnbool dbusIsInterfaceName(string string_)Checks if string is a valid D-Bus interface name.
fnbool dbusIsMemberName(string string_)Checks if string is a valid D-Bus member (e.g. signal or method) name.
fnbool dbusIsName(string string_)Checks if string is a valid D-Bus bus name (either unique or well-known).
fnbool dbusIsSupportedAddress(string string_)Like [gio.global.dbusIsAddress] but also checks if the library supports the transports in string and that key/value pairs for each transport are valid. See the specification of the [D-Bus address f...
fnbool dbusIsUniqueName(string string_)Checks if string is a valid D-Bus unique bus name.
fnubyte[] dbusUnescapeObjectPath(string s)Unescapes an string that was previously escaped with [gio.global.dbusEscapeObjectPath]. If the string is in a format that could not have been returned by [gio.global.dbusEscapeObjectPath], this fun...
fngio.types.IOErrorEnum ioErrorFromErrno(int errNo)Converts `errno.h` error codes into GIO error codes.
fngio.types.IOErrorEnum ioErrorFromFileError(glib.types.FileError fileError)Converts #GFileError error codes into GIO error codes.
fnglib.types.Quark ioErrorQuark()Gets the GIO Error Quark. Returns: a #GQuark.
fnvoid ioModulesScanAllInDirectory(string dirname)Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
fnvoid ioModulesScanAllInDirectoryWithScope(string dirname, gio.iomodule_scope.IOModuleScope scope_)Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.
fnvoid ioSchedulerCancelAllJobs()Cancels all cancellable I/O jobs.
fnvoid ioSchedulerPushJob(gio.types.IOSchedulerJobFunc jobFunc, int ioPriority, gio.cancellable.Cancellable cancellable = null)Schedules the I/O job to run in another thread.
fngio.settings_backend.SettingsBackend keyfileSettingsBackendNew(string filename, string rootPath, string rootGroup = null)Creates a keyfile-backed #GSettingsBackend.
fngio.settings_backend.SettingsBackend memorySettingsBackendNew()Creates a memory-backed #GSettingsBackend.
fnvoid networkingInit()Initializes the platform networking libraries (eg, on Windows, this calls WSAStartup()). GLib will call this itself if it is needed, so you only need to call it if you directly call system networki...
fngio.settings_backend.SettingsBackend nullSettingsBackendNew()Creates a readonly #GSettingsBackend.
fnglib.source.Source pollableSourceNew(gobject.object.ObjectWrap pollableStream)Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource that expects a callback of type #GPollableSourceFunc. The new source does not actually do...
fnglib.source.Source pollableSourceNewFull(gobject.object.ObjectWrap pollableStream, glib.source.Source childSource = null, gio.cancellable.Cancellable cancellable = null)Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource, as with [gio.global.pollableSourceNew], but also attaching child_source (with a dummy ca...
fnptrdiff_t pollableStreamRead(gio.input_stream.InputStream stream, ubyte[] buffer, bool blocking, gio.cancellable.Cancellable cancellable = null)Tries to read from stream, as with [gio.inputstream.InputStream.read] (if blocking is true) or [gio.pollableinput_stream.PollableInputStream.readNonblocking] (if blocking is false). This can be use...
fnptrdiff_t pollableStreamWrite(gio.output_stream.OutputStream stream, ubyte[] buffer, bool blocking, gio.cancellable.Cancellable cancellable = null)Tries to write to stream, as with [gio.outputstream.OutputStream.write] (if blocking is true) or [gio.pollableoutput_stream.PollableOutputStream.writeNonblocking] (if blocking is false). This can b...
fnbool pollableStreamWriteAll(gio.output_stream.OutputStream stream, ubyte[] buffer, bool blocking, out size_t bytesWritten, gio.cancellable.Cancellable cancellable = null)Tries to write count bytes to stream, as with [gio.outputstream.OutputStream.writeAll], but using [gio.global.pollableStreamWrite] rather than [gio.outputstream.OutputStream.write].
fnstring[] resourcesEnumerateChildren(string path, gio.types.ResourceLookupFlags lookupFlags)Returns all the names of children at the specified path in the set of globally registered resources. The return result is a null terminated list of strings which should be released with [glib.globa...
fnbool resourcesGetInfo(string path, gio.types.ResourceLookupFlags lookupFlags, out size_t size, out uint flags)Looks for a file at the specified path in the set of globally registered resources and if found returns information about it.
fnglib.bytes.Bytes resourcesLookupData(string path, gio.types.ResourceLookupFlags lookupFlags)Looks for a file at the specified path in the set of globally registered resources and returns a #GBytes that lets you directly access the data in memory.
fngio.input_stream.InputStream resourcesOpenStream(string path, gio.types.ResourceLookupFlags lookupFlags)Looks for a file at the specified path in the set of globally registered resources and returns a #GInputStream that lets you read the data.
fnvoid resourcesRegister(gio.resource.Resource resource)Registers the resource with the process-global set of resources. Once a resource is registered the files in it can be accessed with the global resource lookup functions like [gio.global.resourcesLo...
fnvoid resourcesUnregister(gio.resource.Resource resource)Unregisters the resource from the process-global set of resources.
fnvoid simpleAsyncReportGerrorInIdle(gobject.object.ObjectWrap object, gio.types.AsyncReadyCallback callback, glib.error.ErrorWrap error)Reports an error in an idle function. Similar to [gio.global.simpleAsyncReportErrorInIdle], but takes a #GError rather than building a new one.
fnbool unixIsMountPathSystemInternal(string mountPath)Determines if mount_path is considered an implementation of the OS. This is primarily used for hiding mountable and mounted volumes that only are used in the OS and has little to no relevance to th...
fnbool unixIsSystemDevicePath(string devicePath)Determines if device_path is considered a block device path which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs ...
fnbool unixIsSystemFsType(string fsType)Determines if fs_type is considered a type of file system which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs to...
fngio.unix_mount_entry.UnixMountEntry unixMountAt(string mountPath, out ulong timeRead)Gets a #GUnixMountEntry for a given mount path. If time_read is set, it will be filled with a unix timestamp for checking if the mounts have changed since with [gio.global.unixMountsChangedSince].
fngio.unix_mount_entry.UnixMountEntry unixMountFor(string filePath, out ulong timeRead)Gets a #GUnixMountEntry for a given file path. If time_read is set, it will be filled with a unix timestamp for checking if the mounts have changed since with [gio.global.unixMountsChangedSince].
fnvoid unixMountFree(gio.unix_mount_entry.UnixMountEntry mountEntry)Frees a unix mount.
fnstring unixMountGetDevicePath(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the device path for a unix mount.
fnstring unixMountGetFsType(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the filesystem type for the unix mount.
fnstring unixMountGetMountPath(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the mount path for a unix mount.
fnstring unixMountGetOptions(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets a comma-separated list of mount options for the unix mount. For example, `rw,relatime,seclabel,data=ordered`.
fnstring unixMountGetRootPath(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes.
fnbool unixMountGuessCanEject(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses whether a Unix mount can be ejected.
fngio.icon.Icon unixMountGuessIcon(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the icon of a Unix mount.
fnstring unixMountGuessName(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the name of a Unix mount. The result is a translated string.
fnbool unixMountGuessShouldDisplay(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses whether a Unix mount should be displayed in the UI.
fngio.icon.Icon unixMountGuessSymbolicIcon(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the symbolic icon of a Unix mount.
fnbool unixMountIsReadonly(gio.unix_mount_entry.UnixMountEntry mountEntry)Checks if a unix mount is mounted read only.
fnbool unixMountIsSystemInternal(gio.unix_mount_entry.UnixMountEntry mountEntry)Checks if a Unix mount is a system mount. This is the Boolean OR of [gio.global.unixIsSystemFsType], [gio.global.unixIsSystemDevicePath] and [gio.global.unixIsMountPathSystemInternal] on mount_entr...
fnbool unixMountPointsChangedSince(ulong time)Checks if the unix mount points have changed since a given unix time.
fngio.unix_mount_point.UnixMountPoint[] unixMountPointsGet(out ulong timeRead)Gets a #GList of #GUnixMountPoint containing the unix mount points. If time_read is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with [gio.globa...
fnbool unixMountsChangedSince(ulong time)Checks if the unix mounts have changed since a given unix time.
fngio.unix_mount_entry.UnixMountEntry[] unixMountsGet(out ulong timeRead)Gets a #GList of #GUnixMountEntry containing the unix mounts. If time_read is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with [gio.global.unix...