View Single Post
Posts: 1,203 | Thanked: 3,027 times | Joined on Dec 2010
#153
How about:

Create a GFile
Code:
GFile *
g_file_new_for_path (const char *path);
Get the enclosing mount for that GFile
Code:
GMount *
g_file_find_enclosing_mount (GFile *file,
                             GCancellable *cancellable,
                             GError **error);
or

Code:
void
g_file_find_enclosing_mount_async (GFile *file,
                                   int io_priority,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);
Then get the volume from the mount
Code:
GVolume *
g_mount_get_volume (GMount *mount);
 

The Following 5 Users Say Thank You to Android_808 For This Useful Post: