Module: Gio

Defined in:
gio2/lib/gio2.rb

Overview

Version:

  • 2.0

Defined Under Namespace

Modules: Action, ActionGroup, ActionMap, AppInfo, AppInfoCreateFlags, ApplicationFlags, AskPasswordFlags, AsyncInitable, AsyncResult, BusNameOwnerFlags, BusNameWatcherFlags, BusType, Converter, ConverterFlags, ConverterResult, CredentialsType, DBusCallFlags, DBusCapabilityFlags, DBusConnectionFlags, DBusError, DBusInterface, DBusInterfaceSkeletonFlags, DBusMessageByteOrder, DBusMessageFlags, DBusMessageHeaderField, DBusMessageType, DBusObject, DBusObjectManager, DBusObjectManagerClientFlags, DBusPropertyInfoFlags, DBusProxyFlags, DBusSendMessageFlags, DBusServerFlags, DBusSignalFlags, DBusSubtreeFlags, DataStreamByteOrder, DataStreamNewlineType, DatagramBased, DesktopAppInfoLookup, Drive, DriveStartFlags, DriveStartStopType, DtlsClientConnection, DtlsConnection, DtlsServerConnection, EmblemOrigin, File, FileAttributeInfoFlags, FileAttributeStatus, FileAttributeType, FileCopyFlags, FileCreateFlags, FileDescriptorBased, FileMeasureFlags, FileMonitorEvent, FileMonitorFlags, FileQueryInfoFlags, FileType, FilesystemPreviewType, IOErrorEnum, IOModuleScopeFlags, IOStreamSpliceFlags, Icon, Initable, ListModel, LoadableIcon, MemoryMonitor, MemoryMonitorWarningLevel, Mount, MountMountFlags, MountOperationResult, MountUnmountFlags, NetworkConnectivity, NetworkMonitor, NotificationPriority, OutputStreamSpliceFlags, PasswordSave, PollableInputStream, PollableOutputStream, PollableReturn, Proxy, ProxyResolver, RemoteActionGroup, ResolverError, ResolverNameLookupFlags, ResolverRecordType, ResourceError, ResourceFlags, ResourceLookupFlags, Seekable, SettingsBindFlags, SocketClientEvent, SocketConnectable, SocketFamily, SocketListenerEvent, SocketMsgFlags, SocketProtocol, SocketType, SubprocessFlags, TestDBusFlags, TlsAuthenticationMode, TlsBackend, TlsCertificateFlags, TlsCertificateRequestFlags, TlsClientConnection, TlsDatabaseLookupFlags, TlsDatabaseVerifyFlags, TlsError, TlsFileDatabase, TlsInteractionResult, TlsPasswordFlags, TlsRehandshakeMode, TlsServerConnection, UnixSocketAddressType, Volume, ZlibCompressorFormat Classes: AppInfoMonitor, AppLaunchContext, Application, ApplicationCommandLine, BufferedInputStream, BufferedOutputStream, BytesIcon, Cancellable, CharsetConverter, ConverterInputStream, ConverterOutputStream, Credentials, DBusActionGroup, DBusAuthObserver, DBusConnection, DBusInterfaceSkeleton, DBusMenuModel, DBusMessage, DBusMethodInvocation, DBusObjectManagerClient, DBusObjectManagerServer, DBusObjectProxy, DBusObjectSkeleton, DBusProxy, DBusServer, DataInputStream, DataOutputStream, DesktopAppInfo, Emblem, EmblemedIcon, Error, FileEnumerator, FileIOStream, FileIcon, FileInfo, FileInputStream, FileMonitor, FileOutputStream, FilenameCompleter, FilterInputStream, FilterOutputStream, IOModule, IOStream, InetAddress, InetAddressMask, InetSocketAddress, InputStream, ListStore, MemoryInputStream, MemoryOutputStream, Menu, MenuAttributeIter, MenuItem, MenuLinkIter, MenuModel, MountOperation, NativeSocketAddress, NativeVolumeMonitor, NetworkAddress, NetworkService, Notification, OutputStream, Permission, PropertyAction, ProxyAddress, ProxyAddressEnumerator, Resolver, Settings, SettingsBackend, SimpleAction, SimpleActionGroup, SimpleAsyncResult, SimpleIOStream, SimplePermission, SimpleProxyResolver, Socket, SocketAddress, SocketAddressEnumerator, SocketClient, SocketConnection, SocketControlMessage, SocketListener, SocketService, Subprocess, SubprocessLauncher, Task, TcpConnection, TcpWrapperConnection, TestDBus, ThemedIcon, ThreadedSocketService, TlsCertificate, TlsConnection, TlsDatabase, TlsInteraction, TlsPassword, UnixConnection, UnixCredentialsMessage, UnixFDList, UnixFDMessage, UnixInputStream, UnixMountMonitor, UnixOutputStream, UnixSocketAddress, Vfs, VolumeMonitor, ZlibCompressor, ZlibDecompressor

Constant Summary collapse

DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME =

Extension point for default handler to URI association. See [Extending GIO].

gio-desktop-app-info-lookup
DRIVE_IDENTIFIER_KIND_UNIX_DEVICE =

The string used to obtain a Unix device path with g_drive_get_identifier().

unix-device
FILE_ATTRIBUTE_ACCESS_CAN_DELETE =

A key in the “access” namespace for checking deletion privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to delete the file.

access::can-delete
FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE =

A key in the “access” namespace for getting execution privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to execute the file.

access::can-execute
FILE_ATTRIBUTE_ACCESS_CAN_READ =

A key in the “access” namespace for getting read privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to read the file.

access::can-read
FILE_ATTRIBUTE_ACCESS_CAN_RENAME =

A key in the “access” namespace for checking renaming privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to rename the file.

access::can-rename
FILE_ATTRIBUTE_ACCESS_CAN_TRASH =

A key in the “access” namespace for checking trashing privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to move the file to the trash.

access::can-trash
FILE_ATTRIBUTE_ACCESS_CAN_WRITE =

A key in the “access” namespace for getting write privileges. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. This attribute will be true if the user is able to write to the file.

access::can-write
FILE_ATTRIBUTE_DOS_IS_ARCHIVE =

A key in the “dos” namespace for checking if the file’s archive flag is set. This attribute is true if the archive flag is set. This attribute is only available for DOS file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

dos::is-archive
FILE_ATTRIBUTE_DOS_IS_MOUNTPOINT =

A key in the “dos” namespace for checking if the file is a NTFS mount point (a volume mount or a junction point). This attribute is true if file is a reparse point of type [IO_REPARSE_TAG_MOUNT_POINT](msdn.microsoft.com/en-us/library/dd541667.aspx). This attribute is only available for DOS file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

dos::is-mountpoint
FILE_ATTRIBUTE_DOS_IS_SYSTEM =

A key in the “dos” namespace for checking if the file’s backup flag is set. This attribute is true if the backup flag is set. This attribute is only available for DOS file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

dos::is-system
FILE_ATTRIBUTE_DOS_REPARSE_POINT_TAG =

A key in the “dos” namespace for getting the file NTFS reparse tag. This value is 0 for files that are not reparse points. See the [Reparse Tags](msdn.microsoft.com/en-us/library/dd541667.aspx) page for possible reparse tag values. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

dos::reparse-point-tag
FILE_ATTRIBUTE_ETAG_VALUE =

A key in the “etag” namespace for getting the value of the file’s entity tag. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

etag::value
FILE_ATTRIBUTE_FILESYSTEM_FREE =

A key in the “filesystem” namespace for getting the number of bytes of free space left on the file system. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

filesystem::free
FILE_ATTRIBUTE_FILESYSTEM_READONLY =

A key in the “filesystem” namespace for checking if the file system is read only. Is set to true if the file system is read only. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

filesystem::readonly
FILE_ATTRIBUTE_FILESYSTEM_REMOTE =

A key in the “filesystem” namespace for checking if the file system is remote. Is set to true if the file system is remote. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

filesystem::remote
FILE_ATTRIBUTE_FILESYSTEM_SIZE =

A key in the “filesystem” namespace for getting the total size (in bytes) of the file system, used in g_file_query_filesystem_info(). Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

filesystem::size
FILE_ATTRIBUTE_FILESYSTEM_TYPE =

A key in the “filesystem” namespace for getting the file system’s type. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

filesystem::type
FILE_ATTRIBUTE_FILESYSTEM_USED =

A key in the “filesystem” namespace for getting the number of bytes of used on the file system. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

filesystem::used
FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW =

A key in the “filesystem” namespace for hinting a file manager application whether it should preview (e.g. thumbnail) files on the file system. The value for this key contain a GFilesystem::PreviewType.

filesystem::use-preview
FILE_ATTRIBUTE_GVFS_BACKEND =

A key in the “gvfs” namespace that gets the name of the current GVFS backend in use. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

gvfs::backend
FILE_ATTRIBUTE_ID_FILE =

A key in the “id” namespace for getting a file identifier. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING. An example use would be during listing files, to avoid recursive directory scanning.

id::file
FILE_ATTRIBUTE_ID_FILESYSTEM =

A key in the “id” namespace for getting the file system identifier. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING. An example use would be during drag and drop to see if the source and target are on the same filesystem (default to move) or not (default to copy).

id::filesystem
FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-eject
FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-mount
FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-poll
FILE_ATTRIBUTE_MOUNTABLE_CAN_START =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-start
FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started degraded. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-start-degraded
FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-stop
FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::can-unmount
FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI =

A key in the “mountable” namespace for getting the HAL UDI for the mountable file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

mountable::hal-udi
FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC =

A key in the “mountable” namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is automatically polled for media. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

mountable::is-media-check-automatic
FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE =

A key in the “mountable” namespace for getting the GDrive::StartStopType. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

mountable::start-stop-type
FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE =

A key in the “mountable” namespace for getting the unix device. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

mountable::unix-device
FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE =

A key in the “mountable” namespace for getting the unix device file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

mountable::unix-device-file
FILE_ATTRIBUTE_OWNER_GROUP =

A key in the “owner” namespace for getting the file owner’s group. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

owner::group
FILE_ATTRIBUTE_OWNER_USER =

A key in the “owner” namespace for getting the user name of the file’s owner. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

owner::user
FILE_ATTRIBUTE_OWNER_USER_REAL =

A key in the “owner” namespace for getting the real name of the user that owns the file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

owner::user-real
FILE_ATTRIBUTE_PREVIEW_ICON =

A key in the “preview” namespace for getting a #GIcon that can be used to get preview of the file. For example, it may be a low resolution thumbnail without metadata. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a #GIcon.

preview::icon
FILE_ATTRIBUTE_RECENT_MODIFIED =

A key in the “recent” namespace for getting time, when the metadata for the file in ‘recent:///` was last changed. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_INT64.

recent::modified
FILE_ATTRIBUTE_SELINUX_CONTEXT =

A key in the “selinux” namespace for getting the file’s SELinux context. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only available if GLib has been built with SELinux support.

selinux::context
FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE =

A key in the “standard” namespace for getting the amount of disk space that is consumed by the file (in bytes). This will generally be larger than the file size (due to block size overhead) but can occasionally be smaller (for example, for sparse files). Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

standard::allocated-size
FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE =

A key in the “standard” namespace for getting the content type of the file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING. The value for this key should contain a valid content type.

standard::content-type
FILE_ATTRIBUTE_STANDARD_COPY_NAME =

A key in the “standard” namespace for getting the copy name of the file. The copy name is an optional version of the name. If available it’s always in UTF8, and corresponds directly to the original filename (only transcoded to UTF8). This is useful if you want to copy the file to another filesystem that might have a different encoding. If the filename is not a valid string in the encoding selected for the filesystem it is in then the copy name will not be set.

Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::copy-name
FILE_ATTRIBUTE_STANDARD_DESCRIPTION =

A key in the “standard” namespace for getting the description of the file. The description is a utf8 string that describes the file, generally containing the filename, but can also contain furter information. Example descriptions could be “filename (on hostname)” for a remote file or “filename (in trash)” for a file in the trash. This is useful for instance as the window title when displaying a directory or for a bookmarks menu.

Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::description
FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME =

A key in the “standard” namespace for getting the display name of the file. A display name is guaranteed to be in UTF8 and can thus be displayed in the UI. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::display-name
FILE_ATTRIBUTE_STANDARD_EDIT_NAME =

A key in the “standard” namespace for edit name of the file. An edit name is similar to the display name, but it is meant to be used when you want to rename the file in the UI. The display name might contain information you don’t want in the new filename (such as “(invalid unicode)” if the filename was in an invalid encoding).

Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::edit-name
FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE =

A key in the “standard” namespace for getting the fast content type. The fast content type isn’t as reliable as the regular one, as it only uses the filename to guess it, but it is faster to calculate than the regular content type. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::fast-content-type
FILE_ATTRIBUTE_STANDARD_ICON =

A key in the “standard” namespace for getting the icon for the file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a #GIcon.

standard::icon
FILE_ATTRIBUTE_STANDARD_IS_BACKUP =

A key in the “standard” namespace for checking if a file is a backup file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

standard::is-backup
FILE_ATTRIBUTE_STANDARD_IS_HIDDEN =

A key in the “standard” namespace for checking if a file is hidden. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

standard::is-hidden
standard::is-symlink
FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL =

A key in the “standard” namespace for checking if a file is virtual. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

standard::is-virtual
FILE_ATTRIBUTE_STANDARD_IS_VOLATILE =

A key in the “standard” namespace for checking if a file is volatile. This is meant for opaque, non-POSIX-like backends to indicate that the URI is not persistent. Applications should look at #G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET for the persistent URI.

Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

standard::is-volatile
FILE_ATTRIBUTE_STANDARD_NAME =

A key in the “standard” namespace for getting the name of the file. The name is the on-disk filename which may not be in any known encoding, and can thus not be generally displayed as is. Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the name in a user interface. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.

standard::name
FILE_ATTRIBUTE_STANDARD_SIZE =

A key in the “standard” namespace for getting the file’s size (in bytes). Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

standard::size
FILE_ATTRIBUTE_STANDARD_SORT_ORDER =

A key in the “standard” namespace for setting the sort order of a file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32. An example use would be in file managers, which would use this key to set the order files are displayed. Files with smaller sort order should be sorted first, and files without sort order as if sort order was zero.

standard::sort-order
FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON =

A key in the “standard” namespace for getting the symbolic icon for the file. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value for this key should contain a #GIcon.

standard::symbolic-icon
standard::symlink-target
FILE_ATTRIBUTE_STANDARD_TARGET_URI =

A key in the “standard” namespace for getting the target URI for the file, in the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

standard::target-uri
FILE_ATTRIBUTE_STANDARD_TYPE =

A key in the “standard” namespace for storing file types. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32. The value for this key should contain a GFile::Type.

standard::type
FILE_ATTRIBUTE_THUMBNAILING_FAILED =

A key in the “thumbnail” namespace for checking if thumbnailing failed. This attribute is true if thumbnailing failed. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

thumbnail::failed
FILE_ATTRIBUTE_THUMBNAIL_IS_VALID =

A key in the “thumbnail” namespace for checking whether the thumbnail is outdated. This attribute is true if the thumbnail is up-to-date with the file it represents, and false if the file has been modified since the thumbnail was generated.

If %G_FILE_ATTRIBUTE_THUMBNAILING_FAILED is true and this attribute is false, it indicates that thumbnailing may be attempted again and may succeed.

Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

thumbnail::is-valid
FILE_ATTRIBUTE_THUMBNAIL_PATH =

A key in the “thumbnail” namespace for getting the path to the thumbnail image. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.

thumbnail::path
FILE_ATTRIBUTE_TIME_ACCESS =

A key in the “time” namespace for getting the time the file was last accessed. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the file was last accessed, in seconds since the UNIX epoch.

time::access
FILE_ATTRIBUTE_TIME_ACCESS_USEC =

A key in the “time” namespace for getting the microseconds of the time the file was last accessed. This should be used in conjunction with #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

time::access-usec
FILE_ATTRIBUTE_TIME_CHANGED =

A key in the “time” namespace for getting the time the file was last changed. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the file was last changed, in seconds since the UNIX epoch.

This corresponds to the traditional UNIX ctime.

time::changed
FILE_ATTRIBUTE_TIME_CHANGED_USEC =

A key in the “time” namespace for getting the microseconds of the time the file was last changed. This should be used in conjunction with #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

time::changed-usec
FILE_ATTRIBUTE_TIME_CREATED =

A key in the “time” namespace for getting the time the file was created. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the file was created, in seconds since the UNIX epoch.

This corresponds to the NTFS ctime.

time::created
FILE_ATTRIBUTE_TIME_CREATED_USEC =

A key in the “time” namespace for getting the microseconds of the time the file was created. This should be used in conjunction with #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

time::created-usec
FILE_ATTRIBUTE_TIME_MODIFIED =

A key in the “time” namespace for getting the time the file was last modified. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the time since the file was modified, in seconds since the UNIX epoch.

time::modified
FILE_ATTRIBUTE_TIME_MODIFIED_USEC =

A key in the “time” namespace for getting the microseconds of the time the file was last modified. This should be used in conjunction with #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

time::modified-usec
FILE_ATTRIBUTE_TRASH_DELETION_DATE =

A key in the “trash” namespace. When requested against items in ‘trash:///`, will return the date and time when the file was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.

trash::deletion-date
FILE_ATTRIBUTE_TRASH_ITEM_COUNT =

A key in the “trash” namespace. When requested against ‘trash:///` returns the number of (toplevel) items in the trash folder. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

trash::item-count
FILE_ATTRIBUTE_TRASH_ORIG_PATH =

A key in the “trash” namespace. When requested against items in ‘trash:///`, will return the original path to the file before it was trashed. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.

trash::orig-path
FILE_ATTRIBUTE_UNIX_BLOCKS =

A key in the “unix” namespace for getting the number of blocks allocated for the file. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

unix::blocks
FILE_ATTRIBUTE_UNIX_BLOCK_SIZE =

A key in the “unix” namespace for getting the block size for the file system. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::block-size
FILE_ATTRIBUTE_UNIX_DEVICE =

A key in the “unix” namespace for getting the device id of the device the file is located on (see stat() documentation). This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::device
FILE_ATTRIBUTE_UNIX_GID =

A key in the “unix” namespace for getting the group ID for the file. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::gid
FILE_ATTRIBUTE_UNIX_INODE =

A key in the “unix” namespace for getting the inode of the file. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.

unix::inode
FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT =

A key in the “unix” namespace for checking if the file represents a UNIX mount point. This attribute is true if the file is a UNIX mount point. Since 2.58, ‘/` is considered to be a mount point. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.

unix::is-mountpoint
FILE_ATTRIBUTE_UNIX_MODE =

A key in the “unix” namespace for getting the mode of the file (e.g. whether the file is a regular file, symlink, etc). See the documentation for ‘lstat()`: this attribute is equivalent to the `st_mode` member of `struct stat`, and includes both the file type and permissions. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::mode
unix::nlink
FILE_ATTRIBUTE_UNIX_RDEV =

A key in the “unix” namespace for getting the device ID for the file (if it is a special file). See lstat() documentation. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::rdev
FILE_ATTRIBUTE_UNIX_UID =

A key in the “unix” namespace for getting the user ID for the file. This attribute is only available for UNIX file systems. Corresponding GFile::AttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.

unix::uid
MEMORY_MONITOR_EXTENSION_POINT_NAME =

Extension point for memory usage monitoring functionality. See [Extending GIO].

gio-memory-monitor
action
action-namespace
icon
label
target
section
submenu
NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME =
gio-native-volume-monitor
NETWORK_MONITOR_EXTENSION_POINT_NAME =

Extension point for network status monitoring functionality. See [Extending GIO].

gio-network-monitor
PROXY_EXTENSION_POINT_NAME =

Extension point for proxy functionality. See [Extending GIO].

gio-proxy
PROXY_RESOLVER_EXTENSION_POINT_NAME =

Extension point for proxy resolving functionality. See [Extending GIO].

gio-proxy-resolver
SETTINGS_BACKEND_EXTENSION_POINT_NAME =

Extension point for GSettings::Backend functionality.

gsettings-backend
TLS_BACKEND_EXTENSION_POINT_NAME =

Extension point for TLS functionality via GTls::Backend. See [Extending GIO].

gio-tls-backend
TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT =

The purpose used to verify the client certificate in a TLS connection. Used by TLS servers.

1.3.6.1.5.5.7.3.2
TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER =

The purpose used to verify the server certificate in a TLS connection. This is the most common purpose in use. Used by TLS clients.

1.3.6.1.5.5.7.3.1
VFS_EXTENSION_POINT_NAME =

Extension point for #GVfs functionality. See [Extending GIO].

gio-vfs
VOLUME_IDENTIFIER_KIND_CLASS =

The string used to obtain the volume class with g_volume_get_identifier().

Known volume classes include ‘device`, `network`, and `loop`. Other classes may be added in the future.

This is intended to be used by applications to classify #GVolume instances into different sections - for example a file manager or file chooser can use this information to show ‘network` volumes under a “Network” heading and `device` volumes under a “Devices” heading.

class
VOLUME_IDENTIFIER_KIND_HAL_UDI =

The string used to obtain a Hal UDI with g_volume_get_identifier().

hal-udi
VOLUME_IDENTIFIER_KIND_LABEL =

The string used to obtain a filesystem label with g_volume_get_identifier().

label
VOLUME_IDENTIFIER_KIND_NFS_MOUNT =

The string used to obtain a NFS mount with g_volume_get_identifier().

nfs-mount
VOLUME_IDENTIFIER_KIND_UNIX_DEVICE =

The string used to obtain a Unix device path with g_volume_get_identifier().

unix-device
VOLUME_IDENTIFIER_KIND_UUID =

The string used to obtain a UUID with g_volume_get_identifier().

uuid
VOLUME_MONITOR_EXTENSION_POINT_NAME =

Extension point for volume monitor functionality. See [Extending GIO].

gio-volume-monitor
LOG_DOMAIN =
"Gio"
Version =
GLib::Version

Instance Method Summary collapse

Instance Method Details

#action_name_is_valid(action_name) ⇒ TrueClass

Checks if action_name is valid.

action_name is valid if it consists only of alphanumeric characters, plus ‘-’ and ‘.’. The empty string is not a valid action name.

It is an error to call this function with a non-utf8 action_name. action_name must not be nil.

Parameters:

  • action_name (String)

    a potential action name

Returns:

  • (TrueClass)

    true if action_name is valid

#action_parse_detailed_name(detailed_name, action_name, target_value) ⇒ TrueClass

Parses a detailed action name into its separate name and target components.

Detailed action names can have three formats.

The first format is used to represent an action name with no target value and consists of just an action name containing no whitespace nor the characters ‘:’, ‘(’ or ‘)’. For example: “app.action”.

The second format is used to represent an action with a target value that is a non-empty string consisting only of alphanumerics, plus ‘-’ and ‘.’. In that case, the action name and target value are separated by a double colon (“::”). For example: “app.action::target”.

The third format is used to represent an action with any type of target value, including strings. The target value follows the action name, surrounded in parens. For example: “app.action(42)”. The target value is parsed using g_variant_parse(). If a tuple-typed value is desired, it must be specified in the same way, resulting in two sets of parens, for example: “app.action((1,2,3))”. A string target can be specified this way as well: “app.action(‘target’)”. For strings, this third format must be used if * target value is empty or contains characters other than alphanumerics, ‘-’ and ‘.’.

Parameters:

  • detailed_name (String)

    a detailed action name

  • action_name (String)

    the action name

  • target_value (GLib::Variant)

    the target value, or nil for no target

Returns:

  • (TrueClass)

    true if successful, else false with error set

#action_print_detailed_name(action_name, target_value) ⇒ String

Formats a detailed action name from action_name and target_value.

It is an error to call this function with an invalid action name.

This function is the opposite of g_action_parse_detailed_name(). It will produce a string that can be parsed back to the action_name and target_value by that function.

See that function for the types of strings that will be printed by this function.

Parameters:

  • action_name (String)

    a valid action name

  • target_value (GLib::Variant)

    a #GVariant target value, or nil

Returns:

  • (String)

    a detailed format string

#app_info_create_from_commandline(commandline, application_name, flags) ⇒ Gio::AppInfo

Creates a new GApp::Info from the given information.

Note that for commandline, the quoting rules of the Exec key of the [freedesktop.org Desktop Entry Specification](freedesktop.org/Standards/desktop-entry-spec) are applied. For example, if the commandline contains percent-encoded URIs, the percent-character must be doubled in order to prevent it from being swallowed by Exec key unquoting. See the specification for exact quoting rules.

Parameters:

  • commandline (Gio::filename)

    the commandline to use

  • application_name (String)

    the application name, or nil to use commandline

  • flags (Gio::AppInfoCreateFlags)

    flags that can specify details of the created GApp::Info

Returns:

#app_info_get_allGLib::List

Gets a list of all of the applications currently registered on this system.

For desktop files, this includes applications that have ‘NoDisplay=true` set or are excluded from display by means of `OnlyShowIn` or `NotShowIn`. See g_app_info_should_show(). The returned list does not include applications which have the `Hidden` key set.

Returns:

  • (GLib::List)

    a newly allocated #GList of references to GApp::Infos.

#app_info_get_all_for_type(content_type) ⇒ GLib::List

Gets a list of all GApp::Infos for a given content type, including the recommended and fallback GApp::Infos. See g_app_info_get_recommended_for_type() and g_app_info_get_fallback_for_type().

Parameters:

  • content_type (String)

    the content type to find a GApp::Info for

Returns:

  • (GLib::List)

    #GList of GApp::Infos for given content_type or nil on error.

#app_info_get_default_for_type(content_type, must_support_uris) ⇒ Gio::AppInfo

Gets the default GApp::Info for a given content type.

Parameters:

  • content_type (String)

    the content type to find a GApp::Info for

  • must_support_uris (TrueClass)

    if true, the GApp::Info is expected to support URIs

Returns:

  • (Gio::AppInfo)

    GApp::Info for given content_type or nil on error.

#app_info_get_default_for_uri_scheme(uri_scheme) ⇒ Gio::AppInfo

Gets the default application for handling URIs with the given URI scheme. A URI scheme is the initial part of the URI, up to but not including the ‘:’, e.g. “http”, “ftp” or “sip”.

Parameters:

  • uri_scheme (String)

    a string containing a URI scheme.

Returns:

  • (Gio::AppInfo)

    GApp::Info for given uri_scheme or nil on error.

#app_info_get_fallback_for_type(content_type) ⇒ GLib::List

Gets a list of fallback GApp::Infos for a given content type, i.e. those applications which claim to support the given content type by MIME type subclassing and not directly.

Parameters:

  • content_type (String)

    the content type to find a GApp::Info for

Returns:

  • (GLib::List)

    #GList of GApp::Infos for given content_type or nil on error.

Gets a list of recommended GApp::Infos for a given content type, i.e. those applications which claim to support the given content type exactly, and not by MIME type subclassing. Note that the first application of the list is the last used one, i.e. the last one for which g_app_info_set_as_last_used_for_type() has been called.

Parameters:

  • content_type (String)

    the content type to find a GApp::Info for

Returns:

  • (GLib::List)

    #GList of GApp::Infos for given content_type or nil on error.

#app_info_launch_default_for_uri(uri, context) ⇒ TrueClass

Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detect the type of the file if required.

The D-Bus–activated applications don’t have to be started if your application terminates too soon after this function. To prevent this, use g_app_info_launch_default_for_uri_async() instead.

Parameters:

Returns:

  • (TrueClass)

    true on success, false on error.

#app_info_launch_default_for_uri_async(uri, context, cancellable, callback, user_data) ⇒ nil

Async version of g_app_info_launch_default_for_uri().

This version is useful if you are interested in receiving error information in the case where the application is sandboxed and the portal may present an application chooser dialog to the user.

This is also useful if you want to be sure that the D-Bus–activated applications are really started before termination and if you are interested in receiving error information from their activation.

Parameters:

  • uri (String)

    the uri to show

  • context (Gio::AppLaunchContext)

    an optional GApp::LaunchContext

  • cancellable (Gio::Cancellable)

    a #GCancellable

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback to call when the request is done

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#app_info_launch_default_for_uri_finish(result) ⇒ TrueClass

Finishes an asynchronous launch-default-for-uri operation.

Parameters:

Returns:

  • (TrueClass)

    true if the launch was successful, false if error is set

#app_info_reset_type_associations(content_type) ⇒ nil

Removes all changes to the type associations done by g_app_info_set_as_default_for_type(), g_app_info_set_as_default_for_extension(), g_app_info_add_supports_type() or g_app_info_remove_supports_type().

Parameters:

  • content_type (String)

    a content type

Returns:

  • (nil)

#async_initable_newv_async(object_type, n_parameters, parameters, io_priority, cancellable, callback, user_data) ⇒ nil

Helper function for constructing GAsync::Initable object. This is similar to g_object_newv() but also initializes the object asynchronously.

When the initialization is finished, callback will be called. You can then call g_async_initable_new_finish() to get the new object and check for any errors.

Parameters:

  • object_type (GLib::Type)

    a #GType supporting GAsync::Initable.

  • n_parameters (Integer)

    the number of parameters in parameters

  • parameters (GObject::Parameter)

    the parameters to use to construct the object

  • io_priority (Integer)

    the [I/O priority] of the operation

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback to call when the initialization is finished

  • user_data (GObject)

    the data to pass to callback function

Returns:

  • (nil)

#bus_get(bus_type, cancellable, callback, user_data) ⇒ nil

Asynchronously connects to the message bus specified by bus_type.

When the operation is finished, callback will be invoked. You can then call g_bus_get_finish() to get the result of the operation.

This is an asynchronous failable function. See g_bus_get_sync() for the synchronous version.

Parameters:

  • bus_type (Gio::BusType)

    a GBus::Type

  • cancellable (Gio::Cancellable)

    a #GCancellable or nil

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback to call when the request is satisfied

  • user_data (GObject)

    the data to pass to callback

Returns:

  • (nil)

#bus_get_finish(res) ⇒ Gio::DBusConnection

Finishes an operation started with g_bus_get().

The returned object is a singleton, that is, shared with other callers of g_bus_get() and g_bus_get_sync() for bus_type. In the event that you need a private message bus connection, use g_dbus_address_get_for_bus_sync() and g_dbus_connection_new_for_address().

Note that the returned GDBus::Connection object will (usually) have the GDBus::Connection:exit-on-close property set to true.

Parameters:

  • res (Gio::AsyncResult)

    a GAsync::Result obtained from the #GAsyncReadyCallback passed to g_bus_get()

Returns:

  • (Gio::DBusConnection)

    a GDBus::Connection or nil if error is set. Free with g_object_unref().

#bus_get_sync(bus_type, cancellable) ⇒ Gio::DBusConnection

Synchronously connects to the message bus specified by bus_type. Note that the returned object may shared with other callers, e.g. if two separate parts of a process calls this function with the same bus_type, they will share the same object.

This is a synchronous failable function. See g_bus_get() and g_bus_get_finish() for the asynchronous version.

The returned object is a singleton, that is, shared with other callers of g_bus_get() and g_bus_get_sync() for bus_type. In the event that you need a private message bus connection, use g_dbus_address_get_for_bus_sync() and g_dbus_connection_new_for_address().

Note that the returned GDBus::Connection object will (usually) have the GDBus::Connection:exit-on-close property set to true.

Parameters:

Returns:

  • (Gio::DBusConnection)

    a GDBus::Connection or nil if error is set. Free with g_object_unref().

#bus_own_name(bus_type, name, flags, bus_acquired_handler, name_acquired_handler, name_lost_handler, user_data, user_data_free_func) ⇒ Integer

Starts acquiring name on the bus specified by bus_type and calls name_acquired_handler and name_lost_handler when the name is acquired respectively lost. Callbacks will be invoked in the

thread-default main context][g-main-context-push-thread-default

of the thread you are calling this function from.

You are guaranteed that one of the name_acquired_handler and name_lost_handler callbacks will be invoked after calling this function - there are three possible cases:

  • name_lost_handler with a nil connection (if a connection to the bus can’t be made).

  • bus_acquired_handler then name_lost_handler (if the name can’t be obtained)

  • bus_acquired_handler then name_acquired_handler (if the name was obtained).

When you are done owning the name, just call g_bus_unown_name() with the owner id this function returns.

If the name is acquired or lost (for example another application could acquire the name if you allow replacement or the application currently owning the name exits), the handlers are also invoked. If the GDBus::Connection that is used for attempting to own the name closes, then name_lost_handler is invoked since it is no longer possible for other processes to access the process.

You cannot use g_bus_own_name() several times for the same name (unless interleaved with calls to g_bus_unown_name()) - only the first call will work.

Another guarantee is that invocations of name_acquired_handler and name_lost_handler are guaranteed to alternate; that is, if name_acquired_handler is invoked then you are guaranteed that the next time one of the handlers is invoked, it will be name_lost_handler. The reverse is also true.

If you plan on exporting objects (using e.g. g_dbus_connection_register_object()), note that it is generally too late to export the objects in name_acquired_handler. Instead, you can do this in bus_acquired_handler since you are guaranteed that this will run before name is requested from the bus.

This behavior makes it very simple to write applications that wants to [own names] and export objects. Simply register objects to be exported in bus_acquired_handler and unregister the objects (if any) in name_lost_handler.

Parameters:

  • bus_type (Gio::BusType)

    the type of bus to own a name on

  • name (String)

    the well-known name to own

  • flags (Gio::BusNameOwnerFlags)

    a set of flags from the GBus::NameOwnerFlags enumeration

  • bus_acquired_handler (Gio::BusAcquiredCallback)

    handler to invoke when connected to the bus of type bus_type or nil

  • name_acquired_handler (Gio::BusNameAcquiredCallback)

    handler to invoke when name is acquired or nil

  • name_lost_handler (Gio::BusNameLostCallback)

    handler to invoke when name is lost or nil

  • user_data (GObject)

    user data to pass to handlers

  • user_data_free_func (GLib::DestroyNotify)

    function for freeing user_data or nil

Returns:

  • (Integer)

    an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.

#bus_own_name_on_connection(connection, name, flags, name_acquired_handler, name_lost_handler, user_data, user_data_free_func) ⇒ Integer

Like g_bus_own_name() but takes a GDBus::Connection instead of a GBus::Type.

Parameters:

  • connection (Gio::DBusConnection)

    a GDBus::Connection

  • name (String)

    the well-known name to own

  • flags (Gio::BusNameOwnerFlags)

    a set of flags from the GBus::NameOwnerFlags enumeration

  • name_acquired_handler (Gio::BusNameAcquiredCallback)

    handler to invoke when name is acquired or nil

  • name_lost_handler (Gio::BusNameLostCallback)

    handler to invoke when name is lost or nil

  • user_data (GObject)

    user data to pass to handlers

  • user_data_free_func (GLib::DestroyNotify)

    function for freeing user_data or nil

Returns:

  • (Integer)

    an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name

#bus_own_name_on_connection_with_closures(connection, name, flags, name_acquired_closure, name_lost_closure) ⇒ Integer

Version of g_bus_own_name_on_connection() using closures instead of callbacks for easier binding in other languages.

Parameters:

  • connection (Gio::DBusConnection)

    a GDBus::Connection

  • name (String)

    the well-known name to own

  • flags (Gio::BusNameOwnerFlags)

    a set of flags from the GBus::NameOwnerFlags enumeration

  • name_acquired_closure (GObject::Closure)

    #GClosure to invoke when name is acquired or nil

  • name_lost_closure (GObject::Closure)

    #GClosure to invoke when name is lost or nil

Returns:

  • (Integer)

    an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.

#bus_own_name_with_closures(bus_type, name, flags, bus_acquired_closure, name_acquired_closure, name_lost_closure) ⇒ Integer

Version of g_bus_own_name() using closures instead of callbacks for easier binding in other languages.

Parameters:

  • bus_type (Gio::BusType)

    the type of bus to own a name on

  • name (String)

    the well-known name to own

  • flags (Gio::BusNameOwnerFlags)

    a set of flags from the GBus::NameOwnerFlags enumeration

  • bus_acquired_closure (GObject::Closure)

    #GClosure to invoke when connected to the bus of type bus_type or nil

  • name_acquired_closure (GObject::Closure)

    #GClosure to invoke when name is acquired or nil

  • name_lost_closure (GObject::Closure)

    #GClosure to invoke when name is lost or nil

Returns:

  • (Integer)

    an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.

#bus_unown_name(owner_id) ⇒ nil

Stops owning a name.

Note that there may still be D-Bus traffic to process (relating to owning and unowning the name) in the current thread-default GMain::Context after this function has returned. You should continue to iterate the GMain::Context until the GDestroy::Notify function passed to g_bus_own_name() is called, in order to avoid memory leaks through callbacks queued on the GMain::Context after it’s stopped being iterated.

Parameters:

  • owner_id (Integer)

    an identifier obtained from g_bus_own_name()

Returns:

  • (nil)

#bus_unwatch_name(watcher_id) ⇒ nil

Stops watching a name.

Note that there may still be D-Bus traffic to process (relating to watching and unwatching the name) in the current thread-default GMain::Context after this function has returned. You should continue to iterate the GMain::Context until the GDestroy::Notify function passed to g_bus_watch_name() is called, in order to avoid memory leaks through callbacks queued on the GMain::Context after it’s stopped being iterated.

Parameters:

  • watcher_id (Integer)

    An identifier obtained from g_bus_watch_name()

Returns:

  • (nil)

#bus_watch_name(bus_type, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func) ⇒ Integer

Starts watching name on the bus specified by bus_type and calls name_appeared_handler and name_vanished_handler when the name is known to have an owner respectively known to lose its owner. Callbacks will be invoked in the

thread-default main context][g-main-context-push-thread-default

of the thread you are calling this function from.

You are guaranteed that one of the handlers will be invoked after calling this function. When you are done watching the name, just call g_bus_unwatch_name() with the watcher id this function returns.

If the name vanishes or appears (for example the application owning the name could restart), the handlers are also invoked. If the GDBus::Connection that is used for watching the name disconnects, then name_vanished_handler is invoked since it is no longer possible to access the name.

Another guarantee is that invocations of name_appeared_handler and name_vanished_handler are guaranteed to alternate; that is, if name_appeared_handler is invoked then you are guaranteed that the next time one of the handlers is invoked, it will be name_vanished_handler. The reverse is also true.

This behavior makes it very simple to write applications that want to take action when a certain [name exists]. Basically, the application should create object proxies in name_appeared_handler and destroy them again (if any) in name_vanished_handler. g_bus_unwatch_name() to stop watching the name.

Parameters:

  • bus_type (Gio::BusType)

    The type of bus to watch a name on.

  • name (String)

    The name (well-known or unique) to watch.

  • flags (Gio::BusNameWatcherFlags)

    Flags from the GBus::NameWatcherFlags enumeration.

  • name_appeared_handler (Gio::BusNameAppearedCallback)

    Handler to invoke when name is known to exist or nil.

  • name_vanished_handler (Gio::BusNameVanishedCallback)

    Handler to invoke when name is known to not exist or nil.

  • user_data (GObject)

    User data to pass to handlers.

  • user_data_free_func (GLib::DestroyNotify)

    Function for freeing user_data or nil.

Returns:

  • (Integer)

    An identifier (never 0) that can be used with

#bus_watch_name_on_connection(connection, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func) ⇒ Integer

Like g_bus_watch_name() but takes a GDBus::Connection instead of a GBus::Type. g_bus_unwatch_name() to stop watching the name.

Parameters:

  • connection (Gio::DBusConnection)

    A GDBus::Connection.

  • name (String)

    The name (well-known or unique) to watch.

  • flags (Gio::BusNameWatcherFlags)

    Flags from the GBus::NameWatcherFlags enumeration.

  • name_appeared_handler (Gio::BusNameAppearedCallback)

    Handler to invoke when name is known to exist or nil.

  • name_vanished_handler (Gio::BusNameVanishedCallback)

    Handler to invoke when name is known to not exist or nil.

  • user_data (GObject)

    User data to pass to handlers.

  • user_data_free_func (GLib::DestroyNotify)

    Function for freeing user_data or nil.

Returns:

  • (Integer)

    An identifier (never 0) that can be used with

#bus_watch_name_on_connection_with_closures(connection, name, flags, name_appeared_closure, name_vanished_closure) ⇒ Integer

Version of g_bus_watch_name_on_connection() using closures instead of callbacks for easier binding in other languages. to exist or nil. to not exist or nil. g_bus_unwatch_name() to stop watching the name.

Parameters:

  • connection (Gio::DBusConnection)

    A GDBus::Connection.

  • name (String)

    The name (well-known or unique) to watch.

  • flags (Gio::BusNameWatcherFlags)

    Flags from the GBus::NameWatcherFlags enumeration.

  • name_appeared_closure (GObject::Closure)

    #GClosure to invoke when name is known

  • name_vanished_closure (GObject::Closure)

    #GClosure to invoke when name is known

Returns:

  • (Integer)

    An identifier (never 0) that can be used with

#bus_watch_name_with_closures(bus_type, name, flags, name_appeared_closure, name_vanished_closure) ⇒ Integer

Version of g_bus_watch_name() using closures instead of callbacks for easier binding in other languages. to exist or nil. to not exist or nil. g_bus_unwatch_name() to stop watching the name.

Parameters:

  • bus_type (Gio::BusType)

    The type of bus to watch a name on.

  • name (String)

    The name (well-known or unique) to watch.

  • flags (Gio::BusNameWatcherFlags)

    Flags from the GBus::NameWatcherFlags enumeration.

  • name_appeared_closure (GObject::Closure)

    #GClosure to invoke when name is known

  • name_vanished_closure (GObject::Closure)

    #GClosure to invoke when name is known

Returns:

  • (Integer)

    An identifier (never 0) that can be used with

#content_type_can_be_executable(type) ⇒ TrueClass

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).

Parameters:

  • type (String)

    a content type string

Returns:

  • (TrueClass)

    true if the file type corresponds to a type that can be executable, false otherwise.

#content_type_equals(type1, type2) ⇒ TrueClass

Compares two content types for equality.

Parameters:

  • type1 (String)

    a content type string

  • type2 (String)

    a content type string

Returns:

  • (TrueClass)

    true if the two strings are identical or equivalent, false otherwise.

#content_type_from_mime_type(mime_type) ⇒ String

Tries to find a content type based on the mime type name.

Parameters:

  • mime_type (String)

    a mime type string

Returns:

  • (String)

    Newly allocated string with content type or nil. Free with g_free()

#content_type_get_description(type) ⇒ String

Gets the human readable description of the content type.

Parameters:

  • type (String)

    a content type string

Returns:

  • (String)

    a short description of the content type type. Free the returned string with g_free()

#content_type_get_generic_icon_name(type) ⇒ String

Gets the generic icon name for a content type.

See the [shared-mime-info](www.freedesktop.org/wiki/Specifications/shared-mime-info-spec) specification for more on the generic icon name.

Parameters:

  • type (String)

    a content type string

Returns:

  • (String)

    the registered generic icon name for the given type, or nil if unknown. Free with g_free()

#content_type_get_icon(type) ⇒ Gio::Icon

Gets the icon for a content type.

Parameters:

  • type (String)

    a content type string

Returns:

  • (Gio::Icon)

    #GIcon corresponding to the content type. Free the returned object with g_object_unref()

#content_type_get_mime_dirsArray<String>

Get the list of directories which MIME data is loaded from. See g_content_type_set_mime_dirs() for details.

Returns:

  • (Array<String>)

    nil-terminated list of directories to load MIME data from, including any ‘mime/` subdirectory, and with the first directory to try listed first

#content_type_get_mime_type(type) ⇒ String

Gets the mime type for the content type, if one is registered.

Parameters:

  • type (String)

    a content type string

Returns:

  • (String)

    the registered mime type for the given type, or nil if unknown; free with g_free().

#content_type_get_symbolic_icon(type) ⇒ Gio::Icon

Gets the symbolic icon for a content type.

Parameters:

  • type (String)

    a content type string

Returns:

  • (Gio::Icon)

    symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()

#content_type_guess(filename, data, data_size, result_uncertain) ⇒ String

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 nil, in which case the guess will be based solely on the other argument.

Parameters:

  • filename (String)

    a string, or nil

  • data (Array<Integer>)

    a stream of data, or nil

  • data_size (Integer)

    the size of data

  • result_uncertain (TrueClass)

    return location for the certainty of the result, or nil

Returns:

  • (String)

    a string indicating a guessed content type for the given data. Free with g_free()

#content_type_guess_for_tree(root) ⇒ Array<String>

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.

The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the [shared-mime-info](www.freedesktop.org/wiki/Specifications/shared-mime-info-spec) specification for more on x-content types.

This function is useful in the implementation of g_mount_guess_content_type().

Parameters:

  • root (Gio::File)

    the root of the tree to guess a type for

Returns:

  • (Array<String>)

    an nil-terminated array of zero or more content types. Free with g_strfreev()

#content_type_is_a(type, supertype) ⇒ TrueClass

Determines if type is a subset of supertype.

Parameters:

  • type (String)

    a content type string

  • supertype (String)

    a content type string

Returns:

  • (TrueClass)

    true if type is a kind of supertype, false otherwise.

#content_type_is_mime_type(type, mime_type) ⇒ TrueClass

Determines if type is a subset of mime_type. Convenience wrapper around g_content_type_is_a().

Parameters:

  • type (String)

    a content type string

  • mime_type (String)

    a mime type string

Returns:

  • (TrueClass)

    true if type is a kind of mime_type, false otherwise.

#content_type_is_unknown(type) ⇒ TrueClass

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.

Parameters:

  • type (String)

    a content type string

Returns:

  • (TrueClass)

    true if the type is the unknown type.

#content_type_set_mime_dirs(dirs) ⇒ nil

Set the list of directories used by GIO to load the MIME database. If dirs is nil, the directories used are the default:

- the `mime` subdirectory of the directory in `$XDG_DATA_HOME`
- the `mime` subdirectory of every directory in `$XDG_DATA_DIRS`

This function is intended to be used when writing tests that depend on information stored in the MIME database, in order to control the data.

Typically, in case your tests use %G_TEST_OPTION_ISOLATE_DIRS, but they depend on the system’s MIME database, you should call this function with dirs set to nil before calling g_test_init(), for instance:

// Load MIME data from the system
g_content_type_set_mime_dirs (NULL);
// Isolate the environment
g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);

…

return g_test_run ();

Parameters:

  • dirs (Array<String>)

    nil-terminated list of directories to load MIME data from, including any ‘mime/` subdirectory, and with the first directory to try listed first

Returns:

  • (nil)

#content_types_get_registeredGLib::List

Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using ‘g_list_free_full (list, g_free)`.

Returns:

  • (GLib::List)

    list of the registered content types

#dbus_address_escape_value(string) ⇒ String

Escape string so it can appear in a D-Bus address as the value part of a key-value pair.

For instance, if string is ‘/run/bus-for-:0`, this function would return `/run/bus-for-%3A0`, which could be used in a D-Bus address like `unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0`.

Parameters:

  • string (String)

    an unescaped string to be included in a D-Bus address as the value in a key-value pair

Returns:

  • (String)

    a copy of string with all non-optionally-escaped bytes escaped

#dbus_address_get_for_bus_sync(bus_type, cancellable) ⇒ String

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.

The returned address will be in the [D-Bus address format](dbus.freedesktop.org/doc/dbus-specification.html#addresses).

Parameters:

Returns:

  • (String)

    a valid D-Bus address string for bus_type or nil if error is set

#dbus_address_get_stream(address, cancellable, callback, user_data) ⇒ nil

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-Bus address format](dbus.freedesktop.org/doc/dbus-specification.html#addresses).

When the operation is finished, callback will be invoked. You can then call g_dbus_address_get_stream_finish() to get the result of the operation.

This is an asynchronous failable function. See g_dbus_address_get_stream_sync() for the synchronous version.

Parameters:

  • address (String)

    A valid D-Bus address.

  • cancellable (Gio::Cancellable)

    A #GCancellable or nil.

  • callback (Gio::AsyncReadyCallback)

    A GAsync::ReadyCallback to call when the request is satisfied.

  • user_data (GObject)

    Data to pass to callback.

Returns:

  • (nil)

#dbus_address_get_stream_finish(res, out_guid) ⇒ Gio::IOStream

Finishes an operation started with g_dbus_address_get_stream().

Parameters:

  • res (Gio::AsyncResult)

    A GAsync::Result obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().

  • out_guid (String)

    nil or return location to store the GUID extracted from address, if any.

Returns:

#dbus_address_get_stream_sync(address, out_guid, cancellable) ⇒ Gio::IOStream

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-Bus address format](dbus.freedesktop.org/doc/dbus-specification.html#addresses).

This is a synchronous failable function. See g_dbus_address_get_stream() for the asynchronous version.

Parameters:

  • address (String)

    A valid D-Bus address.

  • out_guid (String)

    nil or return location to store the GUID extracted from address, if any.

  • cancellable (Gio::Cancellable)

    A #GCancellable or nil.

Returns:

#dbus_annotation_info_lookup(annotations, name) ⇒ String

Looks up the value of an annotation.

The cost of this function is O(n) in number of annotations.

Parameters:

  • annotations (Array<Gio::DBusAnnotationInfo>)

    A nil-terminated array of annotations or nil.

  • name (String)

    The name of the annotation to look up.

Returns:

  • (String)

    The value or nil if not found. Do not free, it is owned by annotations.

#dbus_error_encode_gerror(error) ⇒ String

Creates a D-Bus error name to use for error. If error matches a registered error (cf. g_dbus_error_register_error()), the corresponding D-Bus error name will be returned.

Otherwise the a name of the form ‘org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE` will be used. This allows other GDBus applications to map the error on the wire back to a #GError using g_dbus_error_new_for_dbus_error().

This function is typically only used in object mappings to put a #GError on the wire. Regular applications should not use it.

Parameters:

  • error (GLib::Error)

    A #GError.

Returns:

  • (String)

    A D-Bus error name (never nil). Free with g_free().

#dbus_error_get_remote_error(error) ⇒ String

Gets the D-Bus error name used for error, if any.

This function is guaranteed to return a D-Bus error name for all #GErrors returned from functions handling remote method calls (e.g. g_dbus_connection_call_finish()) unless g_dbus_error_strip_remote_error() has been used on error.

Parameters:

  • error (GLib::Error)

    a #GError

Returns:

  • (String)

    an allocated string or nil if the D-Bus error name could not be found. Free with g_free().

#dbus_error_is_remote_error(error) ⇒ TrueClass

Checks if error represents an error received via D-Bus from a remote peer. If so, use g_dbus_error_get_remote_error() to get the name of the error. false otherwise.

Parameters:

  • error (GLib::Error)

    A #GError.

Returns:

  • (TrueClass)

    true if error represents an error from a remote peer,

#dbus_error_new_for_dbus_error(dbus_error_name, dbus_error_message) ⇒ GLib::Error

Creates a #GError based on the contents of dbus_error_name and dbus_error_message.

Errors registered with g_dbus_error_register_error() will be looked up using dbus_error_name and if a match is found, the error domain and code is used. Applications can use g_dbus_error_get_remote_error() to recover dbus_error_name.

If a match against a registered error is not found and the D-Bus error name is in a form as returned by g_dbus_error_encode_gerror() the error domain and code encoded in the name is used to create the #GError. Also, dbus_error_name is added to the error message such that it can be recovered with g_dbus_error_get_remote_error().

Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR in the #G_IO_ERROR error domain is returned. Also, dbus_error_name is added to the error message such that it can be recovered with g_dbus_error_get_remote_error().

In all three cases, dbus_error_name can always be recovered from the returned #GError using the g_dbus_error_get_remote_error() function (unless g_dbus_error_strip_remote_error() hasn’t been used on the returned error).

This function is typically only used in object mappings to prepare #GError instances for applications. Regular applications should not use it.

Parameters:

  • dbus_error_name (String)

    D-Bus error name.

  • dbus_error_message (String)

    D-Bus error message.

Returns:

  • (GLib::Error)

    An allocated #GError. Free with g_error_free().

#dbus_error_quarkGLib::Quark

Returns:

  • (GLib::Quark)

#dbus_error_register_error(error_domain, error_code, dbus_error_name) ⇒ TrueClass

Creates an association to map between dbus_error_name and #GErrors specified by error_domain and error_code.

This is typically done in the routine that returns the #GQuark for an error domain. exists.

Parameters:

  • error_domain (GLib::Quark)

    A #GQuark for an error domain.

  • error_code (Integer)

    An error code.

  • dbus_error_name (String)

    A D-Bus error name.

Returns:

  • (TrueClass)

    true if the association was created, false if it already

#dbus_error_register_error_domain(error_domain_quark_name, quark_volatile, entries, num_entries) ⇒ nil

Helper function for associating a #GError error domain with D-Bus error names.

Parameters:

  • error_domain_quark_name (String)

    The error domain name.

  • quark_volatile (Integer)

    A pointer where to store the #GQuark.

  • entries (Array<Gio::DBusErrorEntry>)

    A pointer to num_entries GDBus::ErrorEntry struct items.

  • num_entries (Integer)

    Number of items to register.

Returns:

  • (nil)

#dbus_error_strip_remote_error(error) ⇒ TrueClass

Looks for extra information in the error message used to recover the D-Bus error name and strips it if found. If stripped, the message field in error will correspond exactly to what was received on the wire.

This is typically used when presenting errors to the end user.

Parameters:

  • error (GLib::Error)

    A #GError.

Returns:

  • (TrueClass)

    true if information was stripped, false otherwise.

#dbus_error_unregister_error(error_domain, error_code, dbus_error_name) ⇒ TrueClass

Destroys an association previously set up with g_dbus_error_register_error().

Parameters:

  • error_domain (GLib::Quark)

    A #GQuark for an error domain.

  • error_code (Integer)

    An error code.

  • dbus_error_name (String)

    A D-Bus error name.

Returns:

  • (TrueClass)

    true if the association was destroyed, false if it wasn’t found.

#dbus_generate_guidString

Generate a D-Bus GUID that can be used with e.g. g_dbus_connection_new().

See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).

Returns:

  • (String)

    A valid D-Bus GUID. Free with g_free().

#dbus_gvalue_to_gvariant(gvalue, type) ⇒ GLib::Variant

Converts a #GValue to a #GVariant of the type indicated by the type parameter.

The conversion is using the following rules:

  • #G_TYPE_STRING: ‘s’, ‘o’, ‘g’ or ‘ay’

  • #G_TYPE_STRV: ‘as’, ‘ao’ or ‘aay’

  • #G_TYPE_BOOLEAN: ‘b’

  • #G_TYPE_UCHAR: ‘y’

  • #G_TYPE_INT: ‘i’, ‘n’

  • #G_TYPE_UINT: ‘u’, ‘q’

  • #G_TYPE_INT64 ‘x’

  • #G_TYPE_UINT64: ‘t’

  • #G_TYPE_DOUBLE: ‘d’

  • #G_TYPE_VARIANT: Any GVariant::Type

This can fail if e.g. gvalue is of type #G_TYPE_STRING and type is [‘i’]. It will also fail for any #GType (including e.g. #G_TYPE_OBJECT and #G_TYPE_BOXED derived-types) not in the table above.

Note that if gvalue is of type #G_TYPE_VARIANT and its value is nil, the empty #GVariant instance (never nil) for type is returned (e.g. 0 for scalar types, the empty string for string types, ‘/’ for object path types, the empty array for any array type and so on).

See the g_dbus_gvariant_to_gvalue() function for how to convert a #GVariant to a #GValue.

Parameters:

  • gvalue (GObject::Value)

    A #GValue to convert to a #GVariant

  • type (GLib::VariantType)

    A GVariant::Type

Returns:

  • (GLib::Variant)

    A #GVariant (never floating) of GVariant::Type type holding the data from gvalue or nil in case of failure. Free with g_variant_unref().

#dbus_gvariant_to_gvalue(value, out_gvalue) ⇒ nil

Converts a #GVariant to a #GValue. If value is floating, it is consumed.

The rules specified in the g_dbus_gvalue_to_gvariant() function are used - this function is essentially its reverse form. So, a #GVariant containing any basic or string array type will be converted to a #GValue containing a basic value or string array. Any other #GVariant (handle, variant, tuple, dict entry) will be converted to a #GValue containing that #GVariant.

The conversion never fails - a valid #GValue is always returned in out_gvalue.

Parameters:

  • value (GLib::Variant)

    A #GVariant.

  • out_gvalue (GObject::Value)

    Return location pointing to a zero-filled (uninitialized) #GValue.

Returns:

  • (nil)

#dbus_is_address(string) ⇒ TrueClass

Checks if string is a [D-Bus address](dbus.freedesktop.org/doc/dbus-specification.html#addresses).

This doesn’t check if string is actually supported by GDBus::Server or GDBus::Connection - use g_dbus_is_supported_address() to do more checks.

Parameters:

  • string (String)

    A string.

Returns:

  • (TrueClass)

    true if string is a valid D-Bus address, false otherwise.

#dbus_is_guid(string) ⇒ TrueClass

Checks if string is a D-Bus GUID.

See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).

Parameters:

  • string (String)

    The string to check.

Returns:

  • (TrueClass)

    true if string is a guid, false otherwise.

#dbus_is_interface_name(string) ⇒ TrueClass

Checks if string is a valid D-Bus interface name.

Parameters:

  • string (String)

    The string to check.

Returns:

  • (TrueClass)

    true if valid, false otherwise.

#dbus_is_member_name(string) ⇒ TrueClass

Checks if string is a valid D-Bus member (e.g. signal or method) name.

Parameters:

  • string (String)

    The string to check.

Returns:

  • (TrueClass)

    true if valid, false otherwise.

#dbus_is_name(string) ⇒ TrueClass

Checks if string is a valid D-Bus bus name (either unique or well-known).

Parameters:

  • string (String)

    The string to check.

Returns:

  • (TrueClass)

    true if valid, false otherwise.

#dbus_is_supported_address(string) ⇒ TrueClass

Like g_dbus_is_address() 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 format](dbus.freedesktop.org/doc/dbus-specification.html#addresses). supported by this library, false if error is set.

Parameters:

  • string (String)

    A string.

Returns:

  • (TrueClass)

    true if string is a valid D-Bus address that is

#dbus_is_unique_name(string) ⇒ TrueClass

Checks if string is a valid D-Bus unique bus name.

Parameters:

  • string (String)

    The string to check.

Returns:

  • (TrueClass)

    true if valid, false otherwise.

#dtls_client_connection_new(base_socket, server_identity) ⇒ Gio::DtlsClientConnection

Creates a new GDtls::ClientConnection wrapping base_socket which is assumed to communicate with the server identified by server_identity.

Parameters:

Returns:

#dtls_server_connection_new(base_socket, certificate) ⇒ Gio::DtlsServerConnection

Creates a new GDtls::ServerConnection wrapping base_socket.

Parameters:

Returns:

#file_new_for_commandline_arg(arg) ⇒ Gio::File

Creates a #GFile with the given argument from the command line. The value of arg can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if arg points to a malformed path.

Note that on Windows, this function expects its argument to be in UTF-8 – not the system code page. This means that you should not use this function with string from argv as it is passed to main(). g_win32_get_command_line() will return a UTF-8 version of the commandline. #GApplication also uses UTF-8 but g_application_command_line_create_file_for_arg() may be more useful for you there. It is also always possible to use this function with GOption::Context arguments of type %G_OPTION_ARG_FILENAME.

Parameters:

  • arg (Gio::filename)

    a command line string

Returns:

  • (Gio::File)

    a new #GFile. Free the returned object with g_object_unref().

#file_new_for_commandline_arg_and_cwd(arg, cwd) ⇒ Gio::File

Creates a #GFile with the given argument from the command line.

This function is similar to g_file_new_for_commandline_arg() except that it allows for passing the current working directory as an argument instead of using the current working directory of the process.

This is useful if the commandline argument was given in a context other than the invocation of the current process.

See also g_application_command_line_create_file_for_arg().

Parameters:

  • arg (Gio::filename)

    a command line string

  • cwd (Gio::filename)

    the current working directory of the commandline

Returns:

#file_new_for_path(path) ⇒ Gio::File

Constructs a #GFile for a given path. This operation never fails, but the returned object might not support any I/O operation if path is malformed.

Parameters:

  • path (Gio::filename)

    a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.

Returns:

  • (Gio::File)

    a new #GFile for the given path. Free the returned object with g_object_unref().

#file_new_for_uri(uri) ⇒ Gio::File

Constructs a #GFile for a given URI. This operation never fails, but the returned object might not support any I/O operation if uri is malformed or if the uri type is not supported.

Parameters:

  • uri (String)

    a UTF-8 string containing a URI

Returns:

  • (Gio::File)

    a new #GFile for the given uri. Free the returned object with g_object_unref().

#file_new_tmp(tmpl, iostream) ⇒ Gio::File

Opens a file in the preferred directory for temporary files (as returned by g_get_tmp_dir()) and returns a #GFile and GFile::IOStream pointing to it.

tmpl should be a string in the GLib file name encoding containing a sequence of six ‘X’ characters, and containing no directory components. If it is nil, a default template is used.

Unlike the other #GFile constructors, this will return nil if a temporary file could not be created.

Parameters:

  • tmpl (Gio::filename)

    Template for the file name, as in g_file_open_tmp(), or nil for a default template

  • iostream (Gio::FileIOStream)

    on return, a GFile::IOStream for the created file

Returns:

  • (Gio::File)

    a new #GFile. Free the returned object with g_object_unref().

#file_parse_name(parse_name) ⇒ Gio::File

Constructs a #GFile with the given parse_name (i.e. something given by g_file_get_parse_name()). This operation never fails, but the returned object might not support any I/O operation if the parse_name cannot be parsed.

Parameters:

  • parse_name (String)

    a file name or path to be parsed

Returns:

#icon_deserialize(value) ⇒ Gio::Icon

Deserializes a #GIcon previously serialized using g_icon_serialize().

Parameters:

  • value (GLib::Variant)

    a #GVariant created with g_icon_serialize()

Returns:

  • (Gio::Icon)

    a #GIcon, or nil when deserialization fails.

#icon_hash(icon) ⇒ Integer

Gets a hash for an icon. use in a GHash::Table or similar data structure.

Parameters:

  • icon (GObject)

    #gconstpointer to an icon object.

Returns:

  • (Integer)

    a #guint containing a hash for the icon, suitable for

#icon_new_for_string(str) ⇒ Gio::Icon

Generate a #GIcon instance from str. This function can fail if str is not valid - see g_icon_to_string() for discussion.

If your application or library provides one or more #GIcon implementations you need to ensure that each #GType is registered with the type system prior to calling g_icon_new_for_string().

Parameters:

  • str (String)

    A string obtained via g_icon_to_string().

Returns:

  • (Gio::Icon)

    An object implementing the #GIcon interface or nil if error is set.

#initable_newv(object_type, n_parameters, parameters, cancellable) ⇒ GObject::Object

Helper function for constructing #GInitable object. This is similar to g_object_newv() but also initializes the object and returns nil, setting an error on failure.

Parameters:

  • object_type (GLib::Type)

    a #GType supporting #GInitable.

  • n_parameters (Integer)

    the number of parameters in parameters

  • parameters (Array<GObject::Parameter>)

    the parameters to use to construct the object

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

Returns:

  • (GObject::Object)

    a newly allocated #GObject, or nil on error

#io_error_from_errno(err_no) ⇒ Gio::IOErrorEnum

Converts errno.h error codes into GIO error codes. The fallback value %G_IO_ERROR_FAILED is returned for error codes not currently handled (but note that future GLib releases may return a more specific value instead).

As %errno is global and may be modified by intermediate function calls, you should save its value as soon as the call which sets it

Parameters:

  • err_no (Integer)

    Error number as defined in errno.h.

Returns:

  • (Gio::IOErrorEnum)

    GIOError::Enum value for the given errno.h error number.

#io_error_quarkGLib::Quark

Gets the GIO Error Quark.

Returns:

  • (GLib::Quark)

    a #GQuark.

#io_extension_point_implement(extension_point_name, type, extension_name, priority) ⇒ Gio::IOExtension

Registers type as extension for the extension point with name extension_point_name.

If type has already been registered as an extension for this extension point, the existing #GIOExtension object is returned.

Parameters:

  • extension_point_name (String)

    the name of the extension point

  • type (GLib::Type)

    the #GType to register as extension

  • extension_name (String)

    the name for the extension

  • priority (Integer)

    the priority for the extension

Returns:

  • (Gio::IOExtension)

    a #GIOExtension object for #GType

#io_extension_point_lookup(name) ⇒ Gio::IOExtensionPoint

Looks up an existing extension point.

Parameters:

  • name (String)

    the name of the extension point

Returns:

  • (Gio::IOExtensionPoint)

    the GIOExtension::Point, or nil if there is no registered extension point with the given name.

#io_extension_point_register(name) ⇒ Gio::IOExtensionPoint

Registers an extension point.

Parameters:

  • name (String)

    The name of the extension point

Returns:

  • (Gio::IOExtensionPoint)

    the new GIOExtension::Point. This object is owned by GIO and should not be freed.

#io_modules_load_all_in_directory(dirname) ⇒ GLib::List

Loads all the modules in the specified directory.

If don’t require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules.

Parameters:

  • dirname (Gio::filename)

    pathname for a directory containing modules to load.

Returns:

  • (GLib::List)

    a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().

#io_modules_load_all_in_directory_with_scope(dirname, scope) ⇒ GLib::List

Loads all the modules in the specified directory.

If don’t require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules.

Parameters:

  • dirname (Gio::filename)

    pathname for a directory containing modules to load.

  • scope (Gio::IOModuleScope)

    a scope to use when scanning the modules.

Returns:

  • (GLib::List)

    a list of #GIOModules loaded from the directory, All the modules are loaded into memory, if you want to unload them (enabling on-demand loading) you must call g_type_module_unuse() on all the modules. Free the list with g_list_free().

#io_modules_scan_all_in_directory(dirname) ⇒ nil

Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.

This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implementes is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name().

If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory().

Parameters:

  • dirname (Gio::filename)

    pathname for a directory containing modules to scan.

Returns:

  • (nil)

#io_modules_scan_all_in_directory_with_scope(dirname, scope) ⇒ nil

Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered.

This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implementes is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name().

If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory().

Parameters:

  • dirname (Gio::filename)

    pathname for a directory containing modules to scan.

  • scope (Gio::IOModuleScope)

    a scope to use when scanning the modules

Returns:

  • (nil)

#io_scheduler_cancel_all_jobsnil

Cancels all cancellable I/O jobs.

A job is cancellable if a #GCancellable was passed into g_io_scheduler_push_job().

Returns:

  • (nil)

#io_scheduler_push_job(job_func, user_data, notify, io_priority, cancellable) ⇒ nil

Schedules the I/O job to run in another thread.

notify will be called on user_data after job_func has returned, regardless whether the job was cancelled or has run to completion.

If cancellable is not nil, it can be used to cancel the I/O job by calling g_cancellable_cancel() or by calling g_io_scheduler_cancel_all_jobs(). of the request.

Parameters:

  • job_func (Gio::IOSchedulerJobFunc)

    a GIOScheduler::JobFunc.

  • user_data (GObject)

    data to pass to job_func

  • notify (GLib::DestroyNotify)

    a GDestroy::Notify for user_data, or nil

  • io_priority (Integer)

    the [I/O priority]

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

Returns:

  • (nil)

#keyfile_settings_backend_new(filename, root_path, root_group) ⇒ Gio::SettingsBackend

Creates a keyfile-backed GSettings::Backend.

The filename of the keyfile to use is given by filename.

All settings read to or written from the backend must fall under the path given in root_path (which must start and end with a slash and not contain two consecutive slashes). root_path may be “/”.

If root_group is non-nil then it specifies the name of the keyfile group used for keys that are written directly below root_path. For example, if root_path is “/apps/example/” and root_group is “toplevel”, then settings the key “/apps/example/enabled” to a value of true will cause the following to appear in the keyfile:

|[

[toplevel]
enabled=true

]|

If root_group is nil then it is not permitted to store keys directly below the root_path.

For keys not stored directly below root_path (ie: in a sub-path), the name of the subpath (with the final slash stripped) is used as the name of the keyfile group. To continue the example, if “/apps/example/profiles/default/font-size” were set to 12 then the following would appear in the keyfile:

|[

[profiles/default]
font-size=12

]|

The backend will refuse writes (and return writability as being false) for keys outside of root_path and, in the event that root_group is nil, also for keys directly under root_path. Writes will also be refused if the backend detects that it has the inability to rewrite the keyfile (ie: the containing directory is not writable).

There is no checking done for your key namespace clashing with the syntax of the key file format. For example, if you have ‘[’ or ‘]’ characters in your path names or ‘=’ in your key names you may be in trouble.

The backend reads default values from a keyfile called ‘defaults` in the directory specified by the GKeyfile::SettingsBackend:defaults-dir property, and a list of locked keys from a text file with the name `locks` in the same location.

Parameters:

  • filename (String)

    the filename of the keyfile

  • root_path (String)

    the path under which all settings keys appear

  • root_group (String)

    the group name corresponding to root_path, or nil

Returns:

#memory_monitor_dup_defaultGio::MemoryMonitor

Gets a reference to the default GMemory::Monitor for the system.

Returns:

#memory_settings_backend_newGio::SettingsBackend

Creates a memory-backed GSettings::Backend.

This backend allows changes to settings, but does not write them to any backing storage, so the next time you run your application, the memory backend will start out with the default values again.

Returns:

#network_monitor_get_defaultGio::NetworkMonitor

Gets the default GNetwork::Monitor for the system.

Returns:

#networking_initnil

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 networking functions (without calling any GLib networking functions first).

Returns:

  • (nil)

#null_settings_backend_newGio::SettingsBackend

Creates a readonly GSettings::Backend.

This backend does not allow changes to settings, so all settings will always have their default values.

Returns:

#pollable_source_new(pollable_stream) ⇒ GLib::Source

Utility method for GPollable::InputStream and #GPollableOutputStream implementations. Creates a new #GSource that expects a callback of type GPollable::SourceFunc. The new source does not actually do anything on its own; use g_source_add_child_source() to add other sources to it to cause it to trigger.

Parameters:

  • pollable_stream (GObject::Object)

    the stream associated with the new source

Returns:

  • (GLib::Source)

    the new #GSource.

#pollable_source_new_full(pollable_stream, child_source, cancellable) ⇒ GLib::Source

Utility method for GPollable::InputStream and #GPollableOutputStream implementations. Creates a new #GSource, as with g_pollable_source_new(), but also attaching child_source (with a dummy callback), and cancellable, if they are non-nil.

Parameters:

  • pollable_stream (GObject::Object)

    the stream associated with the new source

  • child_source (GLib::Source)

    optional child source to attach

  • cancellable (Gio::Cancellable)

    optional #GCancellable to attach

Returns:

  • (GLib::Source)

    the new #GSource.

#pollable_stream_read(stream, buffer, count, blocking, cancellable) ⇒ Gio::gssize

Tries to read from stream, as with g_input_stream_read() (if blocking is true) or g_pollable_input_stream_read_nonblocking() (if blocking is false). This can be used to more easily share code between blocking and non-blocking implementations of a method.

If blocking is false, then stream must be a GPollable::InputStream for which g_pollable_input_stream_can_poll() returns true, or else the behavior is undefined. If blocking is true, then stream does not need to be a GPollable::InputStream.

Parameters:

  • stream (Gio::InputStream)

    a GInput::Stream

  • buffer (Array<Integer>)

    a buffer to read data into

  • count (Integer)

    the number of bytes to read

  • blocking (TrueClass)

    whether to do blocking I/O

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

Returns:

  • (Gio::gssize)

    the number of bytes read, or -1 on error.

#pollable_stream_write(stream, buffer, count, blocking, cancellable) ⇒ Gio::gssize

Tries to write to stream, as with g_output_stream_write() (if blocking is true) or g_pollable_output_stream_write_nonblocking() (if blocking is false). This can be used to more easily share code between blocking and non-blocking implementations of a method.

If blocking is false, then stream must be a GPollable::OutputStream for which g_pollable_output_stream_can_poll() returns true or else the behavior is undefined. If blocking is true, then stream does not need to be a GPollable::OutputStream.

Parameters:

  • stream (Gio::OutputStream)

    a GOutput::Stream.

  • buffer (Array<Integer>)

    the buffer containing the data to write.

  • count (Integer)

    the number of bytes to write

  • blocking (TrueClass)

    whether to do blocking I/O

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

Returns:

  • (Gio::gssize)

    the number of bytes written, or -1 on error.

#pollable_stream_write_all(stream, buffer, count, blocking, bytes_written, cancellable) ⇒ TrueClass

Tries to write count bytes to stream, as with g_output_stream_write_all(), but using g_pollable_stream_write() rather than g_output_stream_write().

On a successful write of count bytes, true is returned, and bytes_written is set to count.

If there is an error during the operation (including %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), false is returned and error is set to indicate the error status, bytes_written is updated to contain the number of bytes written into the stream before the error occurred.

As with g_pollable_stream_write(), if blocking is false, then stream must be a GPollable::OutputStream for which g_pollable_output_stream_can_poll() returns true or else the behavior is undefined. If blocking is true, then stream does not need to be a GPollable::OutputStream.

Parameters:

  • stream (Gio::OutputStream)

    a GOutput::Stream.

  • buffer (Array<Integer>)

    the buffer containing the data to write.

  • count (Integer)

    the number of bytes to write

  • blocking (TrueClass)

    whether to do blocking I/O

  • bytes_written (Integer)

    location to store the number of bytes that was written to the stream

  • cancellable (Gio::Cancellable)

    optional #GCancellable object, nil to ignore.

Returns:

  • (TrueClass)

    true on success, false if there was an error

#proxy_get_default_for_protocol(protocol) ⇒ Gio::Proxy

Find the ‘gio-proxy` extension point for a proxy implementation that supports the specified protocol.

Parameters:

  • protocol (String)

    the proxy protocol name (e.g. http, socks, etc)

Returns:

  • (Gio::Proxy)

    return a #GProxy or NULL if protocol is not supported.

#proxy_resolver_get_defaultGio::ProxyResolver

Gets the default GProxy::Resolver for the system.

Returns:

#resolver_error_quarkGLib::Quark

Gets the #GResolver Error Quark.

Returns:

  • (GLib::Quark)

    a #GQuark.

#resource_error_quarkGLib::Quark

Gets the #GResource Error Quark.

Returns:

  • (GLib::Quark)

    a #GQuark

#resource_load(filename) ⇒ Gio::Resource

Loads a binary resource bundle and creates a #GResource representation of it, allowing you to query it for data.

If you want to use this resource in the global resource namespace you need to register it with g_resources_register().

If filename is empty or the data in it is corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. If filename doesn’t exist, or there is an error in reading it, an error from g_mapped_file_new() will be returned.

Parameters:

  • filename (Gio::filename)

    the path of a filename to load, in the GLib filename encoding

Returns:

  • (Gio::Resource)

    a new #GResource, or nil on error

#resources_enumerate_children(path, lookup_flags) ⇒ Array<String>

Returns all the names of children at the specified path in the set of globally registered resources. The return result is a nil terminated list of strings which should be released with g_strfreev().

lookup_flags controls the behaviour of the lookup.

Parameters:

Returns:

  • (Array<String>)

    an array of constant strings

#resources_get_info(path, lookup_flags, size, flags) ⇒ TrueClass

Looks for a file at the specified path in the set of globally registered resources and if found returns information about it.

lookup_flags controls the behaviour of the lookup.

Parameters:

  • path (String)

    A pathname inside the resource

  • lookup_flags (Gio::ResourceLookupFlags)

    A GResource::LookupFlags

  • size (Integer)

    a location to place the length of the contents of the file, or nil if the length is not needed

  • flags (Integer)

    a location to place the GResource::Flags about the file, or nil if the flags are not needed

Returns:

  • (TrueClass)

    true if the file was found. false if there were errors

#resources_lookup_data(path, lookup_flags) ⇒ GLib::Bytes

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.

The data is always followed by a zero byte, so you can safely use the data as a C string. However, that byte is not included in the size of the GBytes.

For uncompressed resource files this is a pointer directly into the resource bundle, which is typically in some readonly data section in the program binary. For compressed files we allocate memory on the heap and automatically uncompress the data.

lookup_flags controls the behaviour of the lookup.

Parameters:

Returns:

  • (GLib::Bytes)

    #GBytes or nil on error. Free the returned object with g_bytes_unref()

#resources_open_stream(path, lookup_flags) ⇒ Gio::InputStream

Looks for a file at the specified path in the set of globally registered resources and returns a GInput::Stream that lets you read the data.

lookup_flags controls the behaviour of the lookup.

Parameters:

Returns:

  • (Gio::InputStream)

    GInput::Stream or nil on error. Free the returned object with g_object_unref()

#resources_register(resource) ⇒ nil

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 g_resources_lookup_data().

Parameters:

  • resource (Gio::Resource)

    A #GResource

Returns:

  • (nil)

#resources_unregister(resource) ⇒ nil

Unregisters the resource from the process-global set of resources.

Parameters:

  • resource (Gio::Resource)

    A #GResource

Returns:

  • (nil)

#settings_schema_source_get_defaultGio::SettingsSchemaSource

Gets the default system schema source.

This function is not required for normal uses of #GSettings but it may be useful to authors of plugin management systems or to those who want to introspect the content of schemas.

If no schemas are installed, nil will be returned.

The returned source may actually consist of multiple schema sources from different directories, depending on which directories were given in ‘XDG_DATA_DIRS` and `GSETTINGS_SCHEMA_DIR`. For this reason, all lookups performed against the default source should probably be done recursively.

Returns:

  • (Gio::SettingsSchemaSource)

    the default schema source

#simple_async_report_error_in_idle(object, callback, user_data, domain, code, format, array) ⇒ nil

Reports an error in an asynchronous function in an idle function by directly setting the contents of the GAsync::Result with the given error information.

Parameters:

  • object (GObject::Object)

    a #GObject, or nil.

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback.

  • user_data (GObject)

    user data passed to callback.

  • domain (GLib::Quark)

    a #GQuark containing the error domain (usually #G_IO_ERROR).

  • code (Integer)

    a specific error code.

  • format (String)

    a formatted error reporting string.

  • array (Array)

    a list of variables to fill in format.

Returns:

  • (nil)

#simple_async_report_gerror_in_idle(object, callback, user_data, error) ⇒ nil

Reports an error in an idle function. Similar to g_simple_async_report_error_in_idle(), but takes a #GError rather than building a new one.

Parameters:

  • object (GObject::Object)

    a #GObject, or nil

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback.

  • user_data (GObject)

    user data passed to callback.

  • error (GLib::Error)

    the #GError to report

Returns:

  • (nil)

#simple_async_report_take_gerror_in_idle(object, callback, user_data, error) ⇒ nil

Reports an error in an idle function. Similar to g_simple_async_report_gerror_in_idle(), but takes over the caller’s ownership of error, so the caller does not have to free it any more.

Parameters:

  • object (GObject::Object)

    a #GObject, or nil

  • callback (Gio::AsyncReadyCallback)

    a GAsync::ReadyCallback.

  • user_data (GObject)

    user data passed to callback.

  • error (GLib::Error)

    the #GError to report

Returns:

  • (nil)

#srv_target_list_sort(targets) ⇒ GLib::List

Sorts targets in place according to the algorithm in RFC 2782.

Parameters:

  • targets (GLib::List)

    a #GList of GSrv::Target

Returns:

  • (GLib::List)

    the head of the sorted list.

#tls_backend_get_defaultGio::TlsBackend

Gets the default GTls::Backend for the system.

Returns:

#tls_client_connection_new(base_io_stream, server_identity) ⇒ Gio::TlsClientConnection

Creates a new GTls::ClientConnection wrapping base_io_stream (which must have pollable input and output streams) which is assumed to communicate with the server identified by server_identity.

See the documentation for GTls::Connection:base-io-stream for restrictions on when application code can run operations on the base_io_stream after this function has returned. GTls::ClientConnection, or nil on error

Parameters:

Returns:

#tls_error_quarkGLib::Quark

Gets the TLS error quark.

Returns:

  • (GLib::Quark)

    a #GQuark.

#tls_file_database_new(anchors) ⇒ Gio::TlsFileDatabase

Creates a new GTls::FileDatabase which uses anchor certificate authorities in anchors to verify certificate chains.

The certificates in anchors must be PEM encoded. GTls::FileDatabase, or nil on error

Parameters:

  • anchors (Gio::filename)

    filename of anchor certificate authorities.

Returns:

#tls_server_connection_new(base_io_stream, certificate) ⇒ Gio::TlsServerConnection

Creates a new GTls::ServerConnection wrapping base_io_stream (which must have pollable input and output streams).

See the documentation for GTls::Connection:base-io-stream for restrictions on when application code can run operations on the base_io_stream after this function has returned. GTls::ServerConnection, or nil on error

Parameters:

Returns:

#unix_is_mount_path_system_internal(mount_path) ⇒ TrueClass

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 the casual user.

Parameters:

  • mount_path (Gio::filename)

    a mount path, e.g. ‘/media/disk` or `/usr`

Returns:

  • (TrueClass)

    true if mount_path is considered an implementation detail of the OS.

#unix_is_system_device_path(device_path) ⇒ TrueClass

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 to read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux ‘/proc` filesystem.

The list of device paths considered ‘system’ ones may change over time.

Parameters:

  • device_path (String)

    a device path, e.g. ‘/dev/loop0` or `nfsd`

Returns:

  • (TrueClass)

    true if device_path is considered an implementation detail of the OS.

#unix_is_system_fs_type(fs_type) ⇒ TrueClass

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 read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux ‘/proc` filesystem.

The list of file system types considered ‘system’ ones may change over time.

Parameters:

  • fs_type (String)

    a file system type, e.g. ‘procfs` or `tmpfs`

Returns:

  • (TrueClass)

    true if fs_type is considered an implementation detail of the OS.

#unix_mount_at(mount_path, time_read) ⇒ Gio::UnixMountEntry

Gets a GUnix::MountEntry 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 g_unix_mounts_changed_since().

If more mounts have the same mount path, the last matching mount is returned.

Parameters:

  • mount_path (Gio::filename)

    path for a possible unix mount.

  • time_read (Integer)

    guint64 to contain a timestamp.

Returns:

  • (Gio::UnixMountEntry)

    a GUnix::MountEntry.

#unix_mount_compare(mount1, mount2) ⇒ Integer

Compares two unix mounts. or less than mount2, respectively.

Parameters:

  • mount1 (Gio::UnixMountEntry)

    first GUnix::MountEntry to compare.

  • mount2 (Gio::UnixMountEntry)

    second GUnix::MountEntry to compare.

Returns:

  • (Integer)

    1, 0 or -1 if mount1 is greater than, equal to,

#unix_mount_copy(mount_entry) ⇒ Gio::UnixMountEntry

Makes a copy of mount_entry.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry.

Returns:

  • (Gio::UnixMountEntry)

    a new GUnix::MountEntry

#unix_mount_for(file_path, time_read) ⇒ Gio::UnixMountEntry

Gets a GUnix::MountEntry 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 g_unix_mounts_changed_since().

If more mounts have the same mount path, the last matching mount is returned.

Parameters:

  • file_path (Gio::filename)

    file path on some unix mount.

  • time_read (Integer)

    guint64 to contain a timestamp.

Returns:

  • (Gio::UnixMountEntry)

    a GUnix::MountEntry.

#unix_mount_free(mount_entry) ⇒ nil

Frees a unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry.

Returns:

  • (nil)

#unix_mount_get_device_path(mount_entry) ⇒ Gio::filename

Gets the device path for a unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::Mount.

Returns:

  • (Gio::filename)

    a string containing the device path.

#unix_mount_get_fs_type(mount_entry) ⇒ String

Gets the filesystem type for the unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::Mount.

Returns:

  • (String)

    a string containing the file system type.

#unix_mount_get_mount_path(mount_entry) ⇒ Gio::filename

Gets the mount path for a unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    input GUnix::MountEntry to get the mount path for.

Returns:

  • (Gio::filename)

    the mount path for mount_entry.

#unix_mount_get_options(mount_entry) ⇒ String

Gets a comma-separated list of mount options for the unix mount. For example, ‘rw,relatime,seclabel,data=ordered`.

This is similar to g_unix_mount_point_get_options(), but it takes a GUnix::MountEntry as an argument. available.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry.

Returns:

  • (String)

    a string containing the options, or nil if not

#unix_mount_get_root_path(mount_entry) ⇒ String

Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes.

For example, the root path is equal to “/” for mount created by “mount /dev/sda1 /mnt/foo” and “/bar” for “mount –bind /mnt/foo/bar /mnt/bar”.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry.

Returns:

  • (String)

    a string containing the root, or nil if not supported.

#unix_mount_guess_can_eject(mount_entry) ⇒ TrueClass

Guesses whether a Unix mount can be ejected.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry

Returns:

  • (TrueClass)

    true if mount_entry is deemed to be ejectable.

#unix_mount_guess_icon(mount_entry) ⇒ Gio::Icon

Guesses the icon of a Unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry

Returns:

#unix_mount_guess_name(mount_entry) ⇒ String

Guesses the name of a Unix mount. The result is a translated string.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry

Returns:

  • (String)

    A newly allocated string that must be freed with g_free()

#unix_mount_guess_should_display(mount_entry) ⇒ TrueClass

Guesses whether a Unix mount should be displayed in the UI.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry

Returns:

  • (TrueClass)

    true if mount_entry is deemed to be displayable.

#unix_mount_guess_symbolic_icon(mount_entry) ⇒ Gio::Icon

Guesses the symbolic icon of a Unix mount.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::MountEntry

Returns:

#unix_mount_is_readonly(mount_entry) ⇒ TrueClass

Checks if a unix mount is mounted read only.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::Mount.

Returns:

  • (TrueClass)

    true if mount_entry is read only.

#unix_mount_is_system_internal(mount_entry) ⇒ TrueClass

Checks if a Unix mount is a system mount. This is the Boolean OR of g_unix_is_system_fs_type(), g_unix_is_system_device_path() and g_unix_is_mount_path_system_internal() on mount_entry’s properties.

The definition of what a ‘system’ mount entry is may change over time as new file system types and device paths are ignored.

Parameters:

  • mount_entry (Gio::UnixMountEntry)

    a GUnix::Mount.

Returns:

  • (TrueClass)

    true if the unix mount is for a system path.

#unix_mount_points_changed_since(time) ⇒ TrueClass

Checks if the unix mount points have changed since a given unix time.

Parameters:

  • time (Integer)

    guint64 to contain a timestamp.

Returns:

  • (TrueClass)

    true if the mount points have changed since time.

#unix_mount_points_get(time_read) ⇒ GLib::List

Gets a #GList of GUnix::MountPoint 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 g_unix_mount_points_changed_since().

Parameters:

  • time_read (Integer)

    guint64 to contain a timestamp.

Returns:

  • (GLib::List)

    a #GList of the UNIX mountpoints.

#unix_mounts_changed_since(time) ⇒ TrueClass

Checks if the unix mounts have changed since a given unix time.

Parameters:

  • time (Integer)

    guint64 to contain a timestamp.

Returns:

  • (TrueClass)

    true if the mounts have changed since time.

#unix_mounts_get(time_read) ⇒ GLib::List

Gets a #GList of GUnix::MountEntry 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 g_unix_mounts_changed_since().

Parameters:

  • time_read (Integer)

    guint64 to contain a timestamp, or nil

Returns:

  • (GLib::List)

    a #GList of the UNIX mounts.