Could you give me an example of using pysmb library to connect to some samba server? I\'ve read there\'s class smb.SMBConnection.SMBConnection(username, password, my_name, remot
The SMBConnection class will allow you to access the files on the remote Samba server in blocking mode.
To retrieve the list of the files in a shared folder on the remote server,
from smb.SMBConnection import SMBConnection
conn = SMBConnection(userid, password, client_machine_name, remote_machine_name, use_ntlm_v2 = True)
conn.connect(server_ip, 139)
filelist = conn.listPath('shared_folder_name', '/')
The returned filelist will be a list of SharedFile
instances.
More examples can be found in the tests/SMBConnectionTests
folder in the pysmb source package.