osx - Mount Windows smb shares on a Mac using Python -
i create python script mounts windows smb share on mac copies data it. falling @ first hurdle, having problems mounting share. should easy can't work. have trawled internet , have few clues:
mount -t smbfs //user@server/sharename share
this doesn't work have seen solution uses os module mount command:
import os os.system("mount -t smbfs //user@server/sharename share")
but doesn't work either.
i have read creating local mount point remote share mount to. true? , how go this?
many insights
all best
john
i think have figured out:
import os directory = "/users/user.name/foldername" if not os.path.exists(directory): os.makedirs(directory) os.system("mount_smbfs //user.name:password@server/servershare ~/foldername")
this check whether local folder called foldername exists , create if doesn't. mount smb share using defined username/password.
Comments
Post a Comment