Is there a library for SMB file transfer?

Hi!

For a set of tests I need to get a file from a windows server via the SMB protocol. Is there a library supporting that? I did not find anything relateted but maybe my seach skills are just bad :slight_smile:

Thanks!

I haven’t seen any library for RF but smbclient binary probably should do the trick. Its part of Samba suite and should work “standalone” even on windows if you can locate pre-built binaries.. And quick googling mentioned smbclientng · PyPI .. Readme doesn’t mention about how to use it as library so you probably need to look for https://robotframework.org/robotframework/latest/libraries/Process.html to execute it or smbclient from samba..

Everything you need for this should be covered by OperatingSystem Library.

Use Run to

  • run mount (with the -t cifs option) to mount the network share to a mount point if you’re running on linux/mac
  • run net use command to map a network drive on windows

After that use the other keywords from the same library for all the file manipulation actions you need

Dave.

Thanks for your replies. I managed to get it working with the smbprotocol Python library.