Re: Directory name of mounted URI



Hi Prakash,

not sure that this is still valid, it seems that the email was sent before two months, but I received it today for some reason...

Please be aware of GIO/GVfs has been designed to be used over GIO API using URI and POSIX access over FUSE mount point is a just limited fallback.

The following pseudocode should help you to answer your question:
GFile *file = g_file_new_for_uri (uri);
g_file_mount_enclosing_volume (file, ...);
...
GMount *mount = g_file_find_enclosing_mount (file, ...)
GFile *root = g_mount_get_root (mount);
gchar *path = g_file_get_path (root);

It is not possible to specify own folder, the folder name is based on mount parameters...

Regards

Ondrej

2017-08-19 23:56 GMT+02:00 Prakash Sabapathy <prakash_sabapathy hotmail com>:

Hi,

I've managed to write a small program in c++ that can mount and unmount shares using GIO. This was developed based on code in gvfs-mount.c in gvfs.

Two questions:

(1) How can one determine where a given URI is mounted in the filesystem using the GIO API?

For example, one of my shares is mounted under ~/.gvfs/smb-share:server-192.168.56.1,share-users.

The output of 'gvfs-mount -l -i' is:

Mount(0): users on 192.168.56.1 -> smb://192.168.56.1/users/
  Type: GDaemonMount
  default_location=smb://192.168.56.1/users/
  themed icons:  [folder-remote]  [folder]
  symbolic themed icons:  [folder-remote-symbolic]  [folder-symbolic]  [folder-remote]  [folder]
  can_unmount=1
  can_eject=0
  is_shadowed=0

However it's not clear how the output corresponds to the directory name. Is there a function call in GIO to determine the directory where the share is mounted in the filesystem?

(2) Is there any way to choose the directory name using GIO? i.e. from ~/.gvfs/smb-share:server-192.168.56.1,share-users to ~/.gvfs/somethingelse for example?

Regards
Prakash


_______________________________________________
gvfs-list mailing list
gvfs-list gnome org
https://mail.gnome.org/mailman/listinfo/gvfs-list




--
Ondrej Holy
Software Engineer, Core Desktop Development
Red Hat Czech s.r.o


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]