GIO Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <gio/gunixmounts.h> GUnixMountPoint; GUnixMountEntry; GUnixMountMonitor; void g_unix_mount_free (GUnixMountEntry *mount_entry
); gint g_unix_mount_compare (GUnixMountEntry *mount1
,GUnixMountEntry *mount2
); const char * g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry
); const char * g_unix_mount_get_device_path (GUnixMountEntry *mount_entry
); const char * g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry
); gboolean g_unix_mount_is_readonly (GUnixMountEntry *mount_entry
); gboolean g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry
); GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry
); char * g_unix_mount_guess_name (GUnixMountEntry *mount_entry
); gboolean g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry
); gboolean g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry
); void g_unix_mount_point_free (GUnixMountPoint *mount_point
); gint g_unix_mount_point_compare (GUnixMountPoint *mount1
,GUnixMountPoint *mount2
); const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point
); const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point
); const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point
); gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point
); gboolean g_unix_mount_point_is_user_mountable (GUnixMountPoint *mount_point
); gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point
); GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point
); char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point
); gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point
); GList * g_unix_mount_points_get (guint64 *time_read
); GList * g_unix_mounts_get (guint64 *time_read
); GUnixMountEntry * g_unix_mount_at (const char *mount_path
,guint64 *time_read
); gboolean g_unix_mounts_changed_since (guint64 time
); gboolean g_unix_mount_points_changed_since (guint64 time
); GUnixMountMonitor * g_unix_mount_monitor_new (void
); void g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor
,int limit_msec
); gboolean g_unix_is_mount_path_system_internal (const char *mount_path
);
Routines for managing mounted UNIX mount points and paths.
Note that <gio/gunixmounts.h>
belongs to the
UNIX-specific GIO interfaces, thus you have to use the
gio-unix-2.0.pc
pkg-config file when using it.
typedef struct _GUnixMountPoint GUnixMountPoint;
Defines a Unix mount point (e.g. /dev
).
This corresponds roughly to a fstab entry.
typedef struct _GUnixMountEntry GUnixMountEntry;
Defines a Unix mount entry (e.g. /media/cdrom
).
This corresponds roughly to a mtab entry.
typedef struct _GUnixMountMonitor GUnixMountMonitor;
Watches GUnixMounts for changes.
void g_unix_mount_free (GUnixMountEntry *mount_entry
);
Frees a unix mount.
|
a GUnixMount. |
gint g_unix_mount_compare (GUnixMountEntry *mount1
,GUnixMountEntry *mount2
);
Compares two unix mounts.
|
first GUnixMountEntry to compare. |
|
second GUnixMountEntry to compare. |
Returns : |
1, 0 or -1 if mount1 is greater than, equal to,
or less than mount2 , respectively. |
const char * g_unix_mount_get_mount_path (GUnixMountEntry *mount_entry
);
Gets the mount path for a unix mount.
|
input GUnixMountEntry to get the mount path for. |
Returns : |
the mount path for mount_entry . |
const char * g_unix_mount_get_device_path (GUnixMountEntry *mount_entry
);
Gets the device path for a unix mount.
|
a GUnixMount. |
Returns : |
a string containing the device path. |
const char * g_unix_mount_get_fs_type (GUnixMountEntry *mount_entry
);
Gets the filesystem type for the unix mount.
|
a GUnixMount. |
Returns : |
a string containing the file system type. |
gboolean g_unix_mount_is_readonly (GUnixMountEntry *mount_entry
);
Checks if a unix mount is mounted read only.
|
a GUnixMount. |
Returns : |
TRUE if mount_entry is read only. |
gboolean g_unix_mount_is_system_internal (GUnixMountEntry *mount_entry
);
Checks if a unix mount is a system path.
|
a GUnixMount. |
Returns : |
TRUE if the unix mount is for a system path. |
GIcon * g_unix_mount_guess_icon (GUnixMountEntry *mount_entry
);
Guesses the icon of a Unix mount.
|
a GUnixMountEntry |
Returns : |
a GIcon. [transfer full] |
char * g_unix_mount_guess_name (GUnixMountEntry *mount_entry
);
Guesses the name of a Unix mount. The result is a translated string.
|
a GUnixMountEntry |
Returns : |
A newly allocated string that must
be freed with g_free()
|
gboolean g_unix_mount_guess_can_eject (GUnixMountEntry *mount_entry
);
Guesses whether a Unix mount can be ejected.
|
a GUnixMountEntry |
Returns : |
TRUE if mount_entry is deemed to be ejectable. |
gboolean g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry
);
Guesses whether a Unix mount should be displayed in the UI.
|
a GUnixMountEntry |
Returns : |
TRUE if mount_entry is deemed to be displayable. |
void g_unix_mount_point_free (GUnixMountPoint *mount_point
);
Frees a unix mount point.
|
unix mount point to free. |
gint g_unix_mount_point_compare (GUnixMountPoint *mount1
,GUnixMountPoint *mount2
);
Compares two unix mount points.
|
a GUnixMount. |
|
a GUnixMount. |
Returns : |
1, 0 or -1 if mount1 is greater than, equal to,
or less than mount2 , respectively. |
const char * g_unix_mount_point_get_mount_path (GUnixMountPoint *mount_point
);
Gets the mount path for a unix mount point.
|
a GUnixMountPoint. |
Returns : |
a string containing the mount path. |
const char * g_unix_mount_point_get_device_path (GUnixMountPoint *mount_point
);
Gets the device path for a unix mount point.
|
a GUnixMountPoint. |
Returns : |
a string containing the device path. |
const char * g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point
);
Gets the file system type for the mount point.
|
a GUnixMountPoint. |
Returns : |
a string containing the file system type. |
gboolean g_unix_mount_point_is_readonly (GUnixMountPoint *mount_point
);
Checks if a unix mount point is read only.
|
a GUnixMountPoint. |
Returns : |
TRUE if a mount point is read only. |
gboolean g_unix_mount_point_is_user_mountable
(GUnixMountPoint *mount_point
);
Checks if a unix mount point is mountable by the user.
|
a GUnixMountPoint. |
Returns : |
TRUE if the mount point is user mountable. |
gboolean g_unix_mount_point_is_loopback (GUnixMountPoint *mount_point
);
Checks if a unix mount point is a loopback device.
|
a GUnixMountPoint. |
Returns : |
TRUE if the mount point is a loopback. FALSE otherwise. |
GIcon * g_unix_mount_point_guess_icon (GUnixMountPoint *mount_point
);
Guesses the icon of a Unix mount point.
|
a GUnixMountPoint |
Returns : |
a GIcon. [transfer full] |
char * g_unix_mount_point_guess_name (GUnixMountPoint *mount_point
);
Guesses the name of a Unix mount point. The result is a translated string.
|
a GUnixMountPoint |
Returns : |
A newly allocated string that must
be freed with g_free()
|
gboolean g_unix_mount_point_guess_can_eject (GUnixMountPoint *mount_point
);
Guesses whether a Unix mount point can be ejected.
|
a GUnixMountPoint |
Returns : |
TRUE if mount_point is deemed to be ejectable. |
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_mounts_points_changed_since()
.
|
guint64 to contain a timestamp. [out][allow-none] |
Returns : |
a GList of the UNIX mountpoints. [element-type GUnixMountPoint][transfer full] |
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()
.
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()
.
|
path for a possible unix mount. |
|
guint64 to contain a timestamp. [out][allow-none] |
Returns : |
a GUnixMountEntry. [transfer full] |
gboolean g_unix_mounts_changed_since (guint64 time
);
Checks if the unix mounts have changed since a given unix time.
|
guint64 to contain a timestamp. |
Returns : |
TRUE if the mounts have changed since time . |
gboolean g_unix_mount_points_changed_since (guint64 time
);
Checks if the unix mount points have changed since a given unix time.
|
guint64 to contain a timestamp. |
Returns : |
TRUE if the mount points have changed since time . |
GUnixMountMonitor * g_unix_mount_monitor_new (void
);
Gets a new GUnixMountMonitor. The default rate limit for which the
monitor will report consecutive changes for the mount and mount
point entry files is the default for a GFileMonitor. Use
g_unix_mount_monitor_set_rate_limit()
to change this.
Returns : |
a GUnixMountMonitor. |
void g_unix_mount_monitor_set_rate_limit (GUnixMountMonitor *mount_monitor
,int limit_msec
);
Sets the rate limit to which the mount_monitor
will report
consecutive change events to the mount and mount point entry files.
|
a GUnixMountMonitor |
|
a integer with the limit in milliseconds to poll for changes. |
Since 2.18
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.
|
a mount path, e.g. /media/disk
or /usr
|
Returns : |
TRUE if mount_path is considered an implementation detail
of the OS. |
"mountpoints-changed"
signalvoid user_function (GUnixMountMonitor *monitor,
gpointer user_data) : Run Last
Emitted when the unix mount points have changed.
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |
"mounts-changed"
signalvoid user_function (GUnixMountMonitor *monitor,
gpointer user_data) : Run Last
Emitted when the unix mounts have changed.
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |