View Single Post
Posts: 3,074 | Thanked: 12,960 times | Joined on Mar 2010 @ Sofia,Bulgaria
#155
Originally Posted by Android_808 View Post
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);
Already tried that, doesn't work. I looked at lots of code over the inet, g_file_find_enclosing_mount is used all over the place, but it doesn't work like one may think of.
I am playing with g_file_find_enclosing_mount(), gio Unix Mounts, GVfs and what not for the last couple of days with no success.

It is even worse - on my ubuntu 14.04, g_volume_monitor_get_mounts() returns only one mount - sftp:// mount to my devuan VM, but nothing about local mounts ("/", "run", ...)
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

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