On macOS, if I mount two volumes whose name is the same, the second one gets renamed, by appending "-1" to its name.
I need a method to determine the original volume name, i.e. without such a suffix. (Of course, I cannot blindly remove any "-" plus digits because the volume may actually be named like this.)
I can find the original name when using the mount
command in Terminal:
//tt@192.168.61.121/NAS2 on /Volumes/NAS2 (smbfs, nodev, nosuid, mounted by tt)
//tt@QNAS%28AFP%29._afpovertcp._tcp.local/NAS2 on /Volumes/NAS2-1 (afpfs, nodev, nosuid, mounted by tt)
Here, I can tell that "/Volumes/NAS2-1" was originally named "NAS2" on the network.
How do I determine the share's name without invoking such tools, but via CF or other macOS functions, with providing the path or URL of the mounted volume (such as "/Volumes/NAS2-1")?