GioUnix.MountEntry

Fields

None

Methods

class

at (mount_path)

class

for_ (file_path)

compare (mount2)

copy ()

free ()

get_device_path ()

get_fs_type ()

get_mount_path ()

get_options ()

get_root_path ()

guess_can_eject ()

guess_icon ()

guess_name ()

guess_should_display ()

guess_symbolic_icon ()

is_readonly ()

is_system_internal ()

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:

(GioUnix.MountEntry 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.

Added 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:

(GioUnix.MountEntry 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.

Added in version 2.84.

compare(mount2)
Parameters:

mount2 (GioUnix.MountEntry) – second [struct`GioUnix`.MountEntry] to compare

Returns:

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

Return type:

int

Compares two Unix mounts.

Added in version 2.84.

copy()
Returns:

a new [struct`GioUnix`.MountEntry]

Return type:

GioUnix.MountEntry

Makes a copy of self.

Added in version 2.84.

free()

Frees a Unix mount.

Added in version 2.84.

get_device_path()
Returns:

a string containing the device path

Return type:

str

Gets the device path for a Unix mount.

Added in version 2.84.

get_fs_type()
Returns:

a string containing the file system type

Return type:

str

Gets the filesystem type for the Unix mount.

Added in version 2.84.

get_mount_path()
Returns:

the mount path for self

Return type:

str

Gets the mount path for a Unix mount.

Added in version 2.84.

get_options()
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 [method`GioUnix`.MountPoint.get_options], but it takes a [struct`GioUnix`.MountEntry] as an argument.

Added in version 2.84.

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

Added in version 2.84.

guess_can_eject()
Returns:

true if self is deemed to be ejectable; false otherwise

Return type:

bool

Guesses whether a Unix mount entry can be ejected.

Added in version 2.84.

guess_icon()
Returns:

a [iface`Gio`.Icon]

Return type:

Gio.Icon

Guesses the icon of a Unix mount entry.

Added in version 2.84.

guess_name()
Returns:

a newly allocated translated string

Return type:

str

Guesses the name of a Unix mount entry.

The result is a translated string.

Added in version 2.84.

guess_should_display()
Returns:

true if self is deemed to be displayable; false otherwise

Return type:

bool

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

Added in version 2.84.

guess_symbolic_icon()
Returns:

a [iface`Gio`.Icon]

Return type:

Gio.Icon

Guesses the symbolic icon of a Unix mount entry.

Added in version 2.84.

is_readonly()
Returns:

true if self is read only; false otherwise

Return type:

bool

Checks if a Unix mount is mounted read only.

Added in version 2.84.

is_system_internal()
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 self’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.

Added in version 2.84.