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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -