Accessing shared windows smb:// folder

S

sa 125

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!
 
T

The Higgs bozo

sa said:
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.
 
L

List.rb

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!


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
 
L

Louis-Philippe

[Note: parts of this message were removed to make it a legal post.]

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 said:
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!

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top