GioUnix.MountEntry

Fields

None

Methods

class

at (mount_path)

class

compare (mount1, mount2)

class

copy (mount_entry)

class

for_ (file_path)

class

free (mount_entry)

class

get_device_path (mount_entry)

class

get_fs_type (mount_entry)

class

get_mount_path (mount_entry)

class

get_options (mount_entry)

class

get_root_path (mount_entry)

class

guess_can_eject (mount_entry)

class

guess_icon (mount_entry)

class

guess_name (mount_entry)

class

guess_should_display (mount_entry)

class

guess_symbolic_icon (mount_entry)

class

is_readonly (mount_entry)

class

is_system_internal (mount_entry)

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 or None, 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:
Returns:

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

Return type:

int

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:

Gio.UnixMountEntry

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 or None, 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:

str

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:

str

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:

str

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:

str or None

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:

str or None

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 by mount /dev/sda1 /mnt/foo and /bar for mount --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:

bool

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:

Gio.Icon

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:

str

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:

bool

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:

Gio.Icon

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:

bool

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:

bool

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.