GioUnix.MountEntry¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
Details¶
- class GioUnix.MountEntry¶
Defines a Unix mount entry (e.g.
/media/cdrom
). This corresponds roughly to a mtab entry.- classmethod at(mount_path)¶
- Parameters:
mount_path (
str
) – path for a possible Unix mount- Returns:
a [struct`GioUnix`.MountEntry]
- time_read:
return location for a timestamp
- Return type:
(
Gio.UnixMountEntry
orNone
, time_read:int
)
Gets a [struct`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 with [func`GioUnix`.mount_entries_changed_since].
If more mounts have the same mount path, the last matching mount is returned.
This will return
NULL
if there is no mount point at mount_path.New in version 2.84.
- classmethod compare(mount1, mount2)¶
- Parameters:
mount1 (
Gio.UnixMountEntry
) – first [struct`GioUnix`.MountEntry] to comparemount2 (
Gio.UnixMountEntry
) – second [struct`GioUnix`.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.
New in version 2.84.
- classmethod copy(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a new [struct`GioUnix`.MountEntry]
- Return type:
Makes a copy of mount_entry.
New in version 2.84.
- classmethod for_(file_path)¶
- Parameters:
file_path (
str
) – file path on some Unix mount- Returns:
a [struct`GioUnix`.MountEntry]
- time_read:
return location for a timestamp
- Return type:
(
Gio.UnixMountEntry
orNone
, time_read:int
)
Gets a [struct`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 with [func`GioUnix`.mount_entries_changed_since].
If more mounts have the same mount path, the last matching mount is returned.
This will return
NULL
if looking up the mount entry fails, if file_path doesn’t exist or there is an I/O error.New in version 2.84.
- classmethod free(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]
Frees a Unix mount.
New in version 2.84.
- classmethod get_device_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a string containing the device path
- Return type:
Gets the device path for a Unix mount.
New in version 2.84.
- classmethod get_fs_type(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a string containing the file system type
- Return type:
Gets the filesystem type for the Unix mount.
New in version 2.84.
- classmethod get_mount_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry] to get the mount path for- Returns:
the mount path for mount_entry
- Return type:
Gets the mount path for a Unix mount.
New in version 2.84.
- classmethod get_options(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a string containing the options, or
NULL
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 [func`GioUnix`.MountPoint.get_options], but it takes a [struct`GioUnix`.MountEntry] as an argument.
New in version 2.84.
- classmethod get_root_path(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a string containing the root, or
NULL
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 a mount created bymount /dev/sda1 /mnt/foo
and/bar
formount --bind /mnt/foo/bar /mnt/bar
.New in version 2.84.
- classmethod guess_can_eject(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
true if mount_entry is deemed to be ejectable; false otherwise
- Return type:
Guesses whether a Unix mount entry can be ejected.
New in version 2.84.
- classmethod guess_icon(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a [iface`Gio`.Icon]
- Return type:
Guesses the icon of a Unix mount entry.
New in version 2.84.
- classmethod guess_name(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a newly allocated translated string
- Return type:
Guesses the name of a Unix mount entry.
The result is a translated string.
New in version 2.84.
- classmethod guess_should_display(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
true if mount_entry is deemed to be displayable; false otherwise
- Return type:
Guesses whether a Unix mount entry should be displayed in the UI.
New in version 2.84.
- classmethod guess_symbolic_icon(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
a [iface`Gio`.Icon]
- Return type:
Guesses the symbolic icon of a Unix mount entry.
New in version 2.84.
- classmethod is_readonly(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
true if mount_entry is read only; false otherwise
- Return type:
Checks if a Unix mount is mounted read only.
New in version 2.84.
- classmethod is_system_internal(mount_entry)¶
- Parameters:
mount_entry (
Gio.UnixMountEntry
) – a [struct`GioUnix`.MountEntry]- Returns:
true if the Unix mount is for a system path; false otherwise
- Return type:
Checks if a Unix mount is a system mount.
This is the Boolean OR of [func`GioUnix`.is_system_fs_type], [func`GioUnix`.is_system_device_path] and [func`GioUnix`.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.
New in version 2.84.