# Possibly a stupid question: How do I read / write to a NAS filesystem

**URL:** <https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397>\
**Category:** Ruby\
**Created:** [February 26, 2009, 6:08am UTC](https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397 "2009-02-26T06:08:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/90ced4/32.png) [@rickm](https://www.ruby-forum.com/u/rickm)\
**Post date:** [February 26, 2009, 6:08am UTC](https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397/1 "2009-02-26T06:08:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rickm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/90ced4/32.png) [@rickm](https://www.ruby-forum.com/u/rickm)\
**Post date:** [February 26, 2009, 7:32am UTC](https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397/2 "2009-02-26T07:32:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rickm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/90ced4/32.png) [@rickm](https://www.ruby-forum.com/u/rickm)\
**Post date:** [February 26, 2009, 12:07pm UTC](https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397/3 "2009-02-26T12:07:17Z")

</div>

2009/2/26 Dylan E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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

---

<div class="post-metadata">

**Author:** ![rickm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/90ced4/32.png) [@rickm](https://www.ruby-forum.com/u/rickm)\
**Post date:** [February 26, 2009, 12:51pm UTC](https://www.ruby-forum.com/t/possibly-a-stupid-question-how-do-i-read-write-to-a-nas-filesystem/161397/4 "2009-02-26T12:51:26Z")

</div>

On Thu, Feb 26, 2009 at 9:05 PM, Michal S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)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?
