I'm looking for a way to read from a samba share. I want to use it like the Dir
class, for example open and read of directories. Is this possible in Ruby?
The Sambala gem should work for you if your host OS is a Posix (UNIX-like) system (not sure about Windows...):
gem install sambala
This gem will work as long as your host OS has a working smbclient executable somewhere in your $PATH. As long as you're using Mac OS X, Linux, or some other UNIX variant, you should be able to run the following command from the terminal to see if you've got smbclient somewhere in your path:
which smbclient
If you don't get a result, do a google search on how to obtain smbclient for your current host OS. If you're on Mac OS X, you can simply install MacPorts and then run the following command from the terminal to get smbclient installed:
sudo port install samba3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With