Functions¶
Details¶
- GioUnix.desktop_app_info_lookup_get_default_for_uri_scheme(lookup, uri_scheme)¶
- Parameters:
lookup (
Gio.DesktopAppInfoLookup
) – aGioUnix.DesktopAppInfoLookup
uri_scheme (
str
) – a string containing a URI scheme.
- Returns:
Gio.AppInfo
for given uri_scheme orNone
on error.- Return type:
Gio.AppInfo
orNone
Gets the default application for launching applications using this URI scheme for a particular
GioUnix.DesktopAppInfoLookup
implementation.The
GioUnix.DesktopAppInfoLookup
interface and this function is used to implementGio.AppInfo.get_default_for_uri_scheme
() backends in a GIO module. There is no reason for applications to use it directly. Applications should useGio.AppInfo.get_default_for_uri_scheme
().Deprecated since version 2.28: The
GioUnix.DesktopAppInfoLookup
interface is deprecated and unused by GIO.
- GioUnix.file_descriptor_based_get_fd(fd_based)¶
- Parameters:
fd_based (
Gio.FileDescriptorBased
) – aGioUnix.FileDescriptorBased
.- Returns:
The file descriptor
- Return type:
Gets the underlying file descriptor.
New in version 2.24.
- GioUnix.is_mount_path_system_internal(mount_path)¶
- Parameters:
mount_path (
str
) – a mount path, e.g./media/disk
or/usr
- Returns:
True
if mount_path is considered an implementation detail of the OS.- Return type:
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.
- GioUnix.is_system_device_path(device_path)¶
- Parameters:
device_path (
str
) – a device path, e.g./dev/loop0
ornfsd
- Returns:
True
if device_path is considered an implementation detail of the OS.- Return type:
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.
New in version 2.56.
- GioUnix.is_system_fs_type(fs_type)¶
- Parameters:
fs_type (
str
) – a file system type, e.g.procfs
ortmpfs
- Returns:
True
if fs_type is considered an implementation detail of the OS.- Return type:
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.
New in version 2.56.
- GioUnix.mount_at(mount_path)¶
- Parameters:
mount_path (
str
) – path for a possible unix mount.- Returns:
-
- time_read:
guint64 to contain a timestamp.
- Return type:
(
Gio.UnixMountEntry
orNone
, time_read:int
)
Gets a
GioUnix.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 withGioUnix.mounts_changed_since
().If more mounts have the same mount path, the last matching mount is returned.
This will return
None
if there is no mount point at mount_path.
- GioUnix.mount_compare(mount1, mount2)¶
- Parameters:
mount1 (
Gio.UnixMountEntry
) – firstGioUnix.MountEntry
to compare.mount2 (
Gio.UnixMountEntry
) – secondGioUnix.MountEntry
to compare.
- Returns:
1, 0 or -1 if mount1 is greater than, equal to, or less than mount2, respectively.
- Return type:
Compares two unix mounts.
- GioUnix.mount_copy(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
.- Returns:
a new
GioUnix.MountEntry
- Return type:
Makes a copy of mount_entry.
New in version 2.54.
- GioUnix.mount_for(file_path)¶
- Parameters:
file_path (
str
) – file path on some unix mount.- Returns:
-
- time_read:
guint64 to contain a timestamp.
- Return type:
(
Gio.UnixMountEntry
orNone
, time_read:int
)
Gets a
GioUnix.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 withGioUnix.mounts_changed_since
().If more mounts have the same mount path, the last matching mount is returned.
This will return
None
if looking up the mount entry fails, if file_path doesn’t exist or there is an I/O error.New in version 2.52.
- GioUnix.mount_free(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
.
Frees a unix mount.
- GioUnix.mount_get_device_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a #GUnixMount.- Returns:
a string containing the device path.
- Return type:
Gets the device path for a unix mount.
- GioUnix.mount_get_fs_type(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a #GUnixMount.- Returns:
a string containing the file system type.
- Return type:
Gets the filesystem type for the unix mount.
- GioUnix.mount_get_mount_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – inputGioUnix.MountEntry
to get the mount path for.- Returns:
the mount path for mount_entry.
- Return type:
Gets the mount path for a unix mount.
- GioUnix.mount_get_options(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
.- Returns:
a string containing the options, or
None
if not available.- Return type:
Gets a comma-separated list of mount options for the unix mount. For example,
rw,relatime,seclabel,data=ordered
.This is similar to
GioUnix.MountPoint.get_options
(), but it takes aGioUnix.MountEntry
as an argument.New in version 2.58.
- GioUnix.mount_get_root_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
.- Returns:
a string containing the root, or
None
if not supported.- Return type:
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”.
New in version 2.60.
- GioUnix.mount_guess_can_eject(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
- Returns:
True
if mount_entry is deemed to be ejectable.- Return type:
Guesses whether a Unix mount can be ejected.
- GioUnix.mount_guess_icon(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
- Returns:
a
Gio.Icon
- Return type:
Guesses the icon of a Unix mount.
- GioUnix.mount_guess_name(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
- Returns:
A newly allocated string that must be freed with
GLib.free
()- Return type:
Guesses the name of a Unix mount. The result is a translated string.
- GioUnix.mount_guess_should_display(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
- Returns:
True
if mount_entry is deemed to be displayable.- Return type:
Guesses whether a Unix mount should be displayed in the UI.
- GioUnix.mount_guess_symbolic_icon(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – aGioUnix.MountEntry
- Returns:
a
Gio.Icon
- Return type:
Guesses the symbolic icon of a Unix mount.
New in version 2.34.
- GioUnix.mount_is_readonly(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a #GUnixMount.- Returns:
True
if mount_entry is read only.- Return type:
Checks if a unix mount is mounted read only.
- GioUnix.mount_is_system_internal(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a #GUnixMount.- Returns:
True
if the unix mount is for a system path.- Return type:
Checks if a Unix mount is a system mount. This is the Boolean OR of
GioUnix.is_system_fs_type
(),GioUnix.is_system_device_path
() andGioUnix.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.
- GioUnix.mount_point_at(mount_path)¶
- Parameters:
mount_path (
str
) – path for a possible unix mount point.- Returns:
a
GioUnix.MountPoint
, orNone
if no match is found.- time_read:
guint64 to contain a timestamp.
- Return type:
(
Gio.UnixMountPoint
orNone
, time_read:int
)
Gets a
GioUnix.MountPoint
for a given mount path. If time_read is set, it will be filled with a unix timestamp for checking if the mount points have changed since withGioUnix.mount_points_changed_since
().If more mount points have the same mount path, the last matching mount point is returned.
New in version 2.66.
- GioUnix.mount_point_compare(mount1, mount2)¶
- Parameters:
mount1 (
Gio.UnixMountPoint
) – a #GUnixMount.mount2 (
Gio.UnixMountPoint
) – a #GUnixMount.
- Returns:
1, 0 or -1 if mount1 is greater than, equal to, or less than mount2, respectively.
- Return type:
Compares two unix mount points.
- GioUnix.mount_point_copy(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
a new
GioUnix.MountPoint
- Return type:
Makes a copy of mount_point.
New in version 2.54.
- GioUnix.mount_point_free(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – unix mount point to free.
Frees a unix mount point.
- GioUnix.mount_point_get_device_path(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
a string containing the device path.
- Return type:
Gets the device path for a unix mount point.
- GioUnix.mount_point_get_fs_type(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
a string containing the file system type.
- Return type:
Gets the file system type for the mount point.
- GioUnix.mount_point_get_mount_path(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
a string containing the mount path.
- Return type:
Gets the mount path for a unix mount point.
- GioUnix.mount_point_get_options(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
a string containing the options.
- Return type:
Gets the options for the mount point.
New in version 2.32.
- GioUnix.mount_point_guess_can_eject(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
- Returns:
True
if mount_point is deemed to be ejectable.- Return type:
Guesses whether a Unix mount point can be ejected.
- GioUnix.mount_point_guess_icon(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
- Returns:
a
Gio.Icon
- Return type:
Guesses the icon of a Unix mount point.
- GioUnix.mount_point_guess_name(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
- Returns:
A newly allocated string that must be freed with
GLib.free
()- Return type:
Guesses the name of a Unix mount point. The result is a translated string.
- GioUnix.mount_point_guess_symbolic_icon(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
- Returns:
a
Gio.Icon
- Return type:
Guesses the symbolic icon of a Unix mount point.
New in version 2.34.
- GioUnix.mount_point_is_loopback(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
- Return type:
Checks if a unix mount point is a loopback device.
- GioUnix.mount_point_is_readonly(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
True
if a mount point is read only.- Return type:
Checks if a unix mount point is read only.
- GioUnix.mount_point_is_user_mountable(mount_point)¶
- Parameters:
mount_point (
Gio.UnixMountPoint
) – aGioUnix.MountPoint
.- Returns:
True
if the mount point is user mountable.- Return type:
Checks if a unix mount point is mountable by the user.
- GioUnix.mount_points_changed_since(time)¶
- Parameters:
time (
int
) – guint64 to contain a timestamp.- Returns:
True
if the mount points have changed since time.- Return type:
Checks if the unix mount points have changed since a given unix time.
- GioUnix.mount_points_get()¶
- Returns:
a
GLib.List
of the UNIX mountpoints.- time_read:
guint64 to contain a timestamp.
- Return type:
([
Gio.UnixMountPoint
], time_read:int
)
Gets a
GLib.List
ofGioUnix.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 withGioUnix.mount_points_changed_since
().
- GioUnix.mounts_changed_since(time)¶
- Parameters:
time (
int
) – guint64 to contain a timestamp.- Returns:
True
if the mounts have changed since time.- Return type:
Checks if the unix mounts have changed since a given unix time.
- GioUnix.mounts_get()¶
- Returns:
a
GLib.List
of the UNIX mounts.- time_read:
guint64 to contain a timestamp, or
None
- Return type:
([
Gio.UnixMountEntry
], time_read:int
)
Gets a
GLib.List
ofGioUnix.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 withGioUnix.mounts_changed_since
().