I'm trying to determine if a directory exists on a shared network drive.
import os
if(os.path.exists('/Volumes')):
print 'path exists'
else:
print 'path does not exist'
This works fine but this fails when passing in this argument: '/Volumes/A21\ 's\ Public\ Folder'
This makes sense to me because this does not exist until I open up the shared drive on Finder. So I guess I need to mount first, which I've tried from the command line first -
mount_smbfs smb://guest@server/A21's Public Folder
This fails, so I'm unsure of what to pass in for the os.path.exists argument. Ideally, I want to be able to mount into /Volumes/A21's Public Folder first, and then later check if that folder exists?
/Volumes
, although I prefer the users home directory because you know it has the proper permissions; you could always make a symlink from/Volumes
to~/mnt
also I suppose... – l'L'l