Forum: Ruby Accessing shared windows smb:// folder

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7db3b1680807d393d40260591b4ae5e0?d=identicon&s=25 sa 125 (sa125)
on 2009-02-17 08:26
I'm running ubuntu linux on an office network with mostly windows
machines. I have a shared network folder that I can access with samba
as:

smb://hostname/shared

I'm trying to write a script that will read the contents of that shared
folder, but can't access it using the above address. I tried to print
the content:

Dir.entries('smb://hostname/shared').each { |e| puts e }

But obviously got a no such directory error. I know this isn't the way
to go, but I can't figure out how to read that location.

Any tips will be great - thanks!
Beb77c4602c3cac7a12149431366ed11?d=identicon&s=25 The Higgs bozo (higgsbozo)
on 2009-02-17 09:20
sa 125 wrote:
>
> Dir.entries('smb://hostname/shared').each { |e| puts e }
>
> But obviously got a no such directory error. I know this isn't the way
> to go, but I can't figure out how to read that location.

I guess the usual way is to mount the smb filesystem and then use it as
any other directory.  Google for +linux +mount +smb.
990bf71a4e84e1145a3131f35656dc18?d=identicon&s=25 List Rb (listx300108u79872)
on 2009-02-17 12:28
(Received via mailing list)
On Feb 17, 2009, at 2:26 AM, sa 125 <s_ayalon@hotmail.com> wrote:

>
> Dir.entries('smb://hostname/shared').each { |e| puts e }
>
> But obviously got a no such directory error. I know this isn't the way
> to go, but I can't figure out how to read that location.
>
> Any tips will be great - thanks!
> --
> Posted via http://www.ruby-forum.com/.
>


 From the windows clients, Dir["\\\\server\\share\\*"]

 From the samb server, just use the actual directory that's mounted.

For other nix hosts, I would setup nfs mount points
54185df1d348bbd34587fcd4f8e4779b?d=identicon&s=25 Louis-Philippe (Guest)
on 2009-02-17 16:12
(Received via mailing list)
there is a (still quite experimental but working) ruby samba client you
could use:
http://sambala.rubyforge.org/

it won't answer the .each method as you would like but may still provide
the
functionnalities you are looking for.

2009/2/17 List.rb <list.rb@gmail.com>
This topic is locked and can not be replied to.