views:

144

answers:

1

Is there an abstraction that will allow me to connect to a samba share in python regardless of my platform?

More information

I do not want to mount a share. I simply want to upload files to a share, such as smbclient's put.

Thanks, Pete

A: 

As per this question, I would use subprocess to execute a mount command in Unix-y systems (most all of them save windows) -- and mountvol on windows, which that SO question doesn't mention. It's a tiny difference in the string to pass to subprocess, easy to encapsulate in a tiny function, which may be the reason I don't think there's any "third party solution" to this issue -- it's just too small an issue;-).

If you don't want to mount the filesystem, nosklo (a frequent SO poster) has made available a package to access the filesystem directly, but I haven't tried that.

Alex Martelli
nosklo's package depends on smbclient which is unavailable on Windows.
slypete