Forum: Ruby possibly a stupid question: How do I read / write to a NAS filesystem

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.
238b0b3a01e0d9891c7a669a468fa84d?d=identicon&s=25 Rick Martin (rmartin)
on 2009-02-26 06:08
(Received via mailing list)
I have a cheapo WD WorldBook NAS that I would like to access from a
Ruby application. This may actually be more about how to properly
mount the NAS so I can access it but I thought I would start here. I
am running Ubutu and when I browse the NAS I see a path
smb://mybookworld/public/
but Dir.entries("smb://mybookworld/public/") doesn't work or any other
form I could dream up.
42773b24e0c3fb506a8a875c058a9dd7?d=identicon&s=25 Dylan Evans (Guest)
on 2009-02-26 07:32
(Received via mailing list)
You will need to mount the NAS drive, after which you will be able to
access
it as part of your file system. When you browse the drive the the file
manager interprets the uri to access the NAS, when you open it Dir is
expecting a regular filepath. Try something along the lines of;
mount -t smbfs //myworldbook/public /mnt/
and
Dir.entries("/mnt/")

But this is just a guess since i don't use samba
F889bf17449ffbf62345d2b2d316a937?d=identicon&s=25 Michal Suchanek (Guest)
on 2009-02-26 12:07
(Received via mailing list)
2009/2/26 Dylan Evans <dylan.star@gmail.com>:
> You will need to mount the NAS drive, after which you will be able to access
> it as part of your file system. When you browse the drive the the file
> manager interprets the uri to access the NAS, when you open it Dir is
> expecting a regular filepath. Try something along the lines of;
> mount -t smbfs //myworldbook/public /mnt/
> and
> Dir.entries("/mnt/")
>

Alternatively, you can use smbclient to access the NAS without mounting.

HTH

Michal
42773b24e0c3fb506a8a875c058a9dd7?d=identicon&s=25 Dylan Evans (Guest)
on 2009-02-26 12:51
(Received via mailing list)
On Thu, Feb 26, 2009 at 9:05 PM, Michal Suchanek
<hramrach@centrum.cz>wrote:

>
> Alternatively, you can use smbclient to access the NAS without mounting.
>

I don't understand how you would do this? Do you mean by using smbclient
to
fetch resources or is there some other usage from ruby i'm not aware of?
This topic is locked and can not be replied to.