Functions
g_unix_mount_free ()
void
g_unix_mount_free (GUnixMountEntry *mount_entry);
Frees a unix mount.
g_unix_mount_compare ()
gint
g_unix_mount_compare (GUnixMountEntry *mount1,
GUnixMountEntry *mount2);
Compares two unix mounts.
Returns
1, 0 or -1 if mount1
is greater than, equal to,
or less than mount2
, respectively.
g_unix_mount_get_mount_path ()
const char *
g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry);
Gets the mount path for a unix mount.
Returns
the mount path for mount_entry
.
[type filename]
g_unix_mount_get_device_path ()
const char *
g_unix_mount_get_device_path (GUnixMountEntry *mount_entry);
Gets the device path for a unix mount.
Returns
a string containing the device path.
[type filename]
g_unix_mount_get_root_path ()
const char *
g_unix_mount_get_root_path (GUnixMountEntry *mount_entry);
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".
Returns
a string containing the root, or NULL if not supported.
[nullable]
Since: 2.60
g_unix_mount_get_fs_type ()
const char *
g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry);
Gets the filesystem type for the unix mount.
Returns
a string containing the file system type.
g_unix_mount_get_options ()
const char *
g_unix_mount_get_options (GUnixMountEntry *mount_entry);
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 GUnixMountEntry as an argument.
Returns
a string containing the options, or NULL if not
available.
[nullable]
Since: 2.58
g_unix_mount_is_readonly ()
gboolean
g_unix_mount_is_readonly (GUnixMountEntry *mount_entry);
Checks if a unix mount is mounted read only.
Returns
TRUE if mount_entry
is read only.
g_unix_mount_guess_icon ()
GIcon *
g_unix_mount_guess_icon (GUnixMountEntry *mount_entry);
Guesses the icon of a Unix mount.
Returns
a GIcon.
[transfer full]
g_unix_mount_guess_symbolic_icon ()
GIcon *
g_unix_mount_guess_symbolic_icon (GUnixMountEntry *mount_entry);
Guesses the symbolic icon of a Unix mount.
Returns
a GIcon.
[transfer full]
Since: 2.34
g_unix_mount_guess_name ()
char *
g_unix_mount_guess_name (GUnixMountEntry *mount_entry);
Guesses the name of a Unix mount.
The result is a translated string.
Returns
A newly allocated string that must
be freed with g_free()
g_unix_mount_guess_can_eject ()
gboolean
g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry);
Guesses whether a Unix mount can be ejected.
Returns
TRUE if mount_entry
is deemed to be ejectable.
g_unix_mount_guess_should_display ()
gboolean
g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry);
Guesses whether a Unix mount should be displayed in the UI.
Returns
TRUE if mount_entry
is deemed to be displayable.
g_unix_mount_point_free ()
void
g_unix_mount_point_free (GUnixMountPoint *mount_point);
Frees a unix mount point.
g_unix_mount_point_compare ()
gint
g_unix_mount_point_compare (GUnixMountPoint *mount1,
GUnixMountPoint *mount2);
Compares two unix mount points.
Returns
1, 0 or -1 if mount1
is greater than, equal to,
or less than mount2
, respectively.
g_unix_mount_point_get_mount_path ()
const char *
g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point);
Gets the mount path for a unix mount point.
Returns
a string containing the mount path.
[type filename]
g_unix_mount_point_get_device_path ()
const char *
g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point);
Gets the device path for a unix mount point.
Returns
a string containing the device path.
[type filename]
g_unix_mount_point_get_fs_type ()
const char *
g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point);
Gets the file system type for the mount point.
Returns
a string containing the file system type.
g_unix_mount_point_get_options ()
const char *
g_unix_mount_point_get_options (GUnixMountPoint *mount_point);
Gets the options for the mount point.
Returns
a string containing the options.
Since: 2.32
g_unix_mount_point_is_readonly ()
gboolean
g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point);
Checks if a unix mount point is read only.
Returns
TRUE if a mount point is read only.
g_unix_mount_point_is_user_mountable ()
gboolean
g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point);
Checks if a unix mount point is mountable by the user.
Returns
TRUE if the mount point is user mountable.
g_unix_mount_point_is_loopback ()
gboolean
g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point);
Checks if a unix mount point is a loopback device.
Returns
TRUE if the mount point is a loopback. FALSE otherwise.
g_unix_mount_point_guess_icon ()
GIcon *
g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point);
Guesses the icon of a Unix mount point.
Returns
a GIcon.
[transfer full]
g_unix_mount_point_guess_symbolic_icon ()
GIcon *
g_unix_mount_point_guess_symbolic_icon
(GUnixMountPoint *mount_point);
Guesses the symbolic icon of a Unix mount point.
Returns
a GIcon.
[transfer full]
Since: 2.34
g_unix_mount_point_guess_name ()
char *
g_unix_mount_point_guess_name (GUnixMountPoint *mount_point);
Guesses the name of a Unix mount point.
The result is a translated string.
Returns
A newly allocated string that must
be freed with g_free()
g_unix_mount_point_guess_can_eject ()
gboolean
g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point);
Guesses whether a Unix mount point can be ejected.
Returns
TRUE if mount_point
is deemed to be ejectable.
g_unix_mount_points_get ()
GList *
g_unix_mount_points_get (guint64 *time_read);
Gets a GList of GUnixMountPoint 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().
Returns
a GList of the UNIX mountpoints.
[element-type GUnixMountPoint][transfer full]
g_unix_mounts_get ()
GList *
g_unix_mounts_get (guint64 *time_read);
Gets a GList of GUnixMountEntry 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().
Returns
a GList of the UNIX mounts.
[element-type GUnixMountEntry][transfer full]
g_unix_mount_at ()
GUnixMountEntry *
g_unix_mount_at (const char *mount_path,
guint64 *time_read);
Gets a GUnixMountEntry 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.
g_unix_mount_for ()
GUnixMountEntry *
g_unix_mount_for (const char *file_path,
guint64 *time_read);
Gets a GUnixMountEntry 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.
Since: 2.52
g_unix_mounts_changed_since ()
gboolean
g_unix_mounts_changed_since (guint64 time);
Checks if the unix mounts have changed since a given unix time.
Returns
TRUE if the mounts have changed since time
.
g_unix_mount_points_changed_since ()
gboolean
g_unix_mount_points_changed_since (guint64 time);
Checks if the unix mount points have changed since a given unix time.
Returns
TRUE if the mount points have changed since time
.
g_unix_mount_monitor_get ()
GUnixMountMonitor *
g_unix_mount_monitor_get (void);
Gets the GUnixMountMonitor for the current thread-default main
context.
The mount monitor can be used to monitor for changes to the list of
mounted filesystems as well as the list of mount points (ie: fstab
entries).
You must only call g_object_unref() on the return value from under
the same main context as you called this function.
Since: 2.44
g_unix_mount_monitor_new ()
GUnixMountMonitor *
g_unix_mount_monitor_new (void);
g_unix_mount_monitor_new has been deprecated since version 2.44 and should not be used in newly-written code.
Use g_unix_mount_monitor_get() instead.
Deprecated alias for g_unix_mount_monitor_get().
This function was never a true constructor, which is why it was
renamed.
g_unix_mount_monitor_set_rate_limit ()
void
g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor,
int limit_msec);
g_unix_mount_monitor_set_rate_limit has been deprecated since version 2.44 and should not be used in newly-written code.
This function does nothing. Don't call it.
This function does nothing.
Before 2.44, this was a partially-effective way of controlling the
rate at which events would be reported under some uncommon
circumstances. Since mount_monitor
is a singleton, it also meant
that calling this function would have side effects for other users of
the monitor.
Since: 2.18
g_unix_is_mount_path_system_internal ()
gboolean
g_unix_is_mount_path_system_internal (const char *mount_path);
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.
Returns
TRUE if mount_path
is considered an implementation detail
of the OS.
g_unix_is_system_fs_type ()
gboolean
g_unix_is_system_fs_type (const char *fs_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.
Returns
TRUE if fs_type
is considered an implementation detail of the OS.
Since: 2.56
g_unix_is_system_device_path ()
gboolean
g_unix_is_system_device_path (const char *device_path);
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.
Returns
TRUE if device_path
is considered an implementation detail of
the OS.
Since: 2.56