Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Connecting to SMB share in python

Reply
Thread Tools

Connecting to SMB share in python

 
 
Ronnie Kwok
Guest
Posts: n/a
 
      09-25-2008
Hello,

I am trying to write a script that copy files from my local machine to a samba
share.

I've notice a library call Pysamba which is a wrapper on smb service but it
requires a compilation of SAMBA with some amendment in order to use it.

Are there alternative method that I could do the same thing?

Thank you for your advise.

ronnie

 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      09-25-2008
Ronnie Kwok wrote:
> Hello,
>
> I am trying to write a script that copy files from my local machine to a samba
> share.



Can't you just mount the share (albeit temporarily) and copy
the files over in the normal way? You haven't said what OS
you're on, but I'm assuming Linux otherwise you'd simply be
talking about a Windows share and copying to a UNC.

TJG
 
Reply With Quote
 
 
 
 
Ronnie Kwok
Guest
Posts: n/a
 
      09-25-2008
Thank you for the reply!

Yes, I am running the script under linux and it will be doing some
processing before copying it over to the samba mount.

It's totally fine to mount it with os.sys(...) approach but I am just
thinking if there's other option.

ronnie


On 2008-09-25 16:36:35 +0800, Tim Golden <(E-Mail Removed)> said:

> Ronnie Kwok wrote:
>> Hello,
>>
>> I am trying to write a script that copy files from my local machine to a samba
>> share.

>
>
> Can't you just mount the share (albeit temporarily) and copy
> the files over in the normal way? You haven't said what OS
> you're on, but I'm assuming Linux otherwise you'd simply be
> talking about a Windows share and copying to a UNC.
>
> TJG



 
Reply With Quote
 
Diez B. Roggisch
Guest
Posts: n/a
 
      09-25-2008
Ronnie Kwok wrote:

> Thank you for the reply!
>
> Yes, I am running the script under linux and it will be doing some
> processing before copying it over to the samba mount.
>
> It's totally fine to mount it with os.sys(...) approach but I am just
> thinking if there's other option.


None that is any more comfortable. If anything, you'd need smbclient or some
such to list and fetch data - which is *much* more complicated that simply
mounting a share defined in fstab.

Diez
 
Reply With Quote
 
Tim Golden
Guest
Posts: n/a
 
      09-25-2008
Ronnie Kwok wrote:
> Yes, I am running the script under linux and it will be doing some
> processing before copying it over to the samba mount.
>
> It's totally fine to mount it with os.sys(...) approach but I am just
> thinking if there's other option.



I'm not really a Linux person but from all I can see
from Googling around a bit, the os.system ("mount/unmount")
option is still the most viable. Hopefully someone with
real expertise can chip in.

BTW, opinion in this ng/mailing list tends to favour
bottom-posting or interleaved posting.

TJG
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
Python and SMB, again... Atila Olah Python 4 09-14-2005 07:24 PM
Wireless for SMB Curtis M Wireless Networking 1 05-02-2005 05:49 PM
Cisco SMB Support Assistant BradReeseCom Cisco 0 04-09-2005 09:14 PM
Accessing SMB share on Mac OSX for file copy John Perl Misc 0 03-02-2005 03:08 PM



Advertisments