Re: Connecting to SMB share in python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Golden

    Re: Connecting to SMB share in python

    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
  • Ronnie Kwok

    #2
    Re: Connecting to SMB share in python

    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 <mail@timgolden .me.uksaid:
    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

    Comment

    • Diez B. Roggisch

      #3
      Re: Connecting to SMB share in python

      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

      Comment

      • Tim Golden

        #4
        Re: Connecting to SMB share in python

        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

        Comment

        Working...