What to pass to the function to get the mount point?

Hi, ALL,
In the mautilusgtkplacesview.c there is a call to g_file_enumerate_children_async (network_file,…);

The second parameter is a string of the attributes.

However this set does not contain the mountpoint folder.

What do I pass to get it? Or it already has that info?

Thank you.

Please explain what you’re trying to achieve while posting a question.

Refer https://en.wikipedia.org/wiki/XY_problem.

Hi,

I’m not sure the mount point is available as attribute…

You can check the list of available attributes by running in a terminal:
gio info /path/to/the/file

The gio info tool itself prints the unix mount point, but does not use attributes for that, but instead other APIs like g_unix_mount_at, g_unix_mount_for.

@Sid ,
When I issue a command

mount /dev/sdb1 /mnt/usb

First parameter is the device name and the second is the mount point on which I can access the device “/“ folder.

What I’m looking for is to get a mount point on which network drive is mounted.

Thank you.

@gwillems ,
Please see my reply to Sid.
What’s best way to achieve this?

I think the mount point is uniquely identifies the device. And so I’d like to use that for this purposes.

Thank you.

Have you looked at the gio info output?

The source code is there: gio/gio-tool-info.c · main · GNOME / GLib · GitLab

More specifically, this is the (extracted) interesting part:

      GUnixMountEntry *entry;
      entry = g_unix_mount_at (path, NULL);
      if (entry == NULL)
        entry = g_unix_mount_for (path, NULL);
      if (entry != NULL)
        {
          mount = g_strescape (g_unix_mount_get_mount_path (entry), NULL);
        }

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.