Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.26 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Read Remote File with Access Permissions
  2. f = open(r'\serverpathtofile', 'r')
  3.        
  4. client = smbclient.SambaClient(server="servername", share="sharename",
  5.     username="foo", password="bar", domain="baz")
  6. f = smb.open('/path/to/file')
  7. data = f.read()
  8. f.close()