开发者

Finding the path of a mounted network share on Mac OS X

I'd like to find out where a network share is mounted when the mount command fails like this:

$ mkdir ~/share
$ mount_afp afp://server/share ~/share
mount_afp: the volume is already mounted

This looked promising...

$ mount
... snip ...
afp_000000004oMw0q76003DF78u-1.2d000006 on /Volumes/share-1 (afpfs, nodev, nosuid, mounted by username)
afp_000000004oMw0q76003DF78u-2.2d000007 on /Volumes/share-2 (afpfs, nodev, nosuid, mounted by username)

It seems like there should be a way to map those long afp_000... numbers to URIs... Is there any way to determine where a volume is mounted given its afp:// URI?

I'm actually executing these commands with Python's subprocess module, s开发者_开发技巧o if there's a module or library that can do it that would be acceptable as well.


Try /Volumes/PUBLIC

(Or whatever Get Info tells you after looking at the file with Finder)

That's what worked for me.


Do you mean where it mounted on the remote server or where its mounted locally? If youre talking on the local system the mountpoint should be in /Network/Servers unless otherwise specified by fstab, autofs or an arg to mount. You could scan /Network/Servers for the share name...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜