I am trying to list all shared folders on a Synology NAS with Python.
So let's say I want a list of every folder on \\DISKSTATION
E.g.: public, homes, movies, etc
Is that possible?
Thanks for your help!
Why not use pysmb
?
pip install pysmb
To list share contents:
from smb.SMBConnection import SMBConnection
conn = SMBConnection('username', 'password', 'local_NetBIOS_name', 'remote_NetBIOS_name')
conn.connect('ip_address')
results = conn.listPath('share_name', '/optionally/some/subfolder')
for x in results:
print x.filename
Will output:
.
..
dir1
dir2
file1
file2