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
fn
void 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.fn
gio.dbus_connection.DBusConnection busGetFinish(gio.async_result.AsyncResult res)Finishes an operation started with [gio.global.busGet].fn
gio.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...fn
uint 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.fn
uint 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.fn
uint 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.fn
uint 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.fn
bool 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).fn
string contentTypeFromMimeType(string mimeType)Tries to find a content type based on the mime type name.fn
string contentTypeGetDescription(string type)Gets the human readable description of the content type.fn
string[] 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 `...fn
string contentTypeGetMimeType(string type)Gets the mime type for the content type, if one is registered.fn
string 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...fn
string[] 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.fn
bool contentTypeIsMimeType(string type, string mimeType)Determines if type is a subset of mime_type. Convenience wrapper around [gio.global.contentTypeIsA].fn
bool 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.fn
void 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:fn
string[] 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...fn
string dbusAddressEscapeValue(string string_)Escape string so it can appear in a D-Bus address as the value part of a key-value pair.fn
string 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.fn
void 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...fn
gio.iostream.IOStream dbusAddressGetStreamFinish(gio.async_result.AsyncResult res, out string outGuid)Finishes an operation started with [gio.global.dbusAddressGetStream].fn
gio.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-...fn
string dbusEscapeObjectPath(string s)This is a language binding friendly version of [gio.global.dbusEscapeObjectPathBytestring].fn
string 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.fn
string dbusGenerateGuid()Generate a D-Bus GUID that can be used with e.g. [gio.dbusconnection.DBusConnection.new].fn
glib.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.fn
void dbusGvariantToGvalue(glib.variant.Variant value, out gobject.value.Value outGvalue)Converts a #GVariant to a #GValue. If value is floating, it is consumed.fn
bool dbusIsAddress(string string_)Checks if string is a [D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).fn
bool dbusIsMemberName(string string_)Checks if string is a valid D-Bus member (e.g. signal or method) name.fn
bool dbusIsName(string string_)Checks if string is a valid D-Bus bus name (either unique or well-known).fn
bool 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...fn
ubyte[] 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...fn
gio.types.IOErrorEnum ioErrorFromErrno(int errNo)Converts `errno.h` error codes into GIO error codes.fn
gio.types.IOErrorEnum ioErrorFromFileError(glib.types.FileError fileError)Converts #GFileError error codes into GIO error codes.fn
void ioModulesScanAllInDirectory(string dirname)Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.fn
void 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.fn
void ioSchedulerPushJob(gio.types.IOSchedulerJobFunc jobFunc, int ioPriority, gio.cancellable.Cancellable cancellable = null)Schedules the I/O job to run in another thread.fn
gio.settings_backend.SettingsBackend keyfileSettingsBackendNew(string filename, string rootPath, string rootGroup = null)Creates a keyfile-backed #GSettingsBackend.fn
gio.settings_backend.SettingsBackend memorySettingsBackendNew()Creates a memory-backed #GSettingsBackend.fn
void 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...fn
gio.settings_backend.SettingsBackend nullSettingsBackendNew()Creates a readonly #GSettingsBackend.fn
glib.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...fn
glib.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...fn
ptrdiff_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...fn
ptrdiff_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...fn
bool 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].fn
string[] 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...fn
bool 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.fn
glib.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.fn
gio.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.fn
void 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...fn
void resourcesUnregister(gio.resource.Resource resource)Unregisters the resource from the process-global set of resources.fn
void 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.fn
bool 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...fn
bool 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 ...fn
bool 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...fn
gio.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].fn
int unixMountCompare(gio.unix_mount_entry.UnixMountEntry mount1, gio.unix_mount_entry.UnixMountEntry mount2)Compares two unix mounts.fn
gio.unix_mount_entry.UnixMountEntry unixMountCopy(gio.unix_mount_entry.UnixMountEntry mountEntry)Makes a copy of mount_entry.fn
gio.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].fn
string unixMountGetDevicePath(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the device path for a unix mount.fn
string unixMountGetFsType(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the filesystem type for the unix mount.fn
string unixMountGetMountPath(gio.unix_mount_entry.UnixMountEntry mountEntry)Gets the mount path for a unix mount.fn
string 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`.fn
string 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.fn
bool unixMountGuessCanEject(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses whether a Unix mount can be ejected.fn
gio.icon.Icon unixMountGuessIcon(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the icon of a Unix mount.fn
string unixMountGuessName(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the name of a Unix mount. The result is a translated string.fn
bool unixMountGuessShouldDisplay(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses whether a Unix mount should be displayed in the UI.fn
gio.icon.Icon unixMountGuessSymbolicIcon(gio.unix_mount_entry.UnixMountEntry mountEntry)Guesses the symbolic icon of a Unix mount.fn
bool unixMountIsReadonly(gio.unix_mount_entry.UnixMountEntry mountEntry)Checks if a unix mount is mounted read only.fn
bool 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...fn
bool unixMountPointsChangedSince(ulong time)Checks if the unix mount points have changed since a given unix time.fn
gio.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...fn
bool unixMountsChangedSince(ulong time)Checks if the unix mounts have changed since a given unix time.fn
gio.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...