Get 'unc' path in OSX of mounted share

↘锁芯ラ 提交于 2019-12-01 13:20:53

After looking into df, I came up with this which works excellent on OSX:

from subprocess import Popen, PIPE

df = Popen('df -P /Volumes/link/to/some/folder', shell=True, stdout=PIPE)
serverAddress = df.stdout.readlines()[1:][0]
serverAddress = serverAddress.split('@')[1]
serverAddress = serverAddress.split('/')[0]
print serverAddress
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!