# Getting list of drives using ruby on rails

**URL:** <https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260>\
**Category:** Rails\
**Created:** [April 23, 2009, 9:08am UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260 "2009-04-23T09:08:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 23, 2009, 9:08am UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/1 "2009-04-23T09:08:51Z")

</div>

Hi All,

I had been assigned work of ruby on rails from two days . Using ruby on  
rails how do we get the list of drives present in a system ex : c:\ ,  
d:\ etc

If anyone know this pls send me the code.

Thanks & Regards,  
Murwath Ali Mehtar.

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 23, 2009, 10:18am UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/2 "2009-04-23T10:18:10Z")

</div>

Murwath M. wrote:

> Hi All,
> 
> I had been assigned work of ruby on rails from two days . Using ruby on  
> rails how do we get the list of drives present in a system ex : c:\ ,  
> d:\ etc
> 
> If anyone know this pls send me the code.
> 
> Thanks & Regards,  
> Murwath Ali Mehtar.

Cananyone pls update me the code , as i require it urgently

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 23, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/3 "2009-04-23T20:27:15Z")

</div>

Murwath M. wrote:

> Hi All,
> 
> I had been assigned work of ruby on rails from two days . Using ruby on  
> rails how do we get the list of drives present in a system ex : c:\ ,  
> d:\ etc

Rails lives on the server side. You’re asking about client-side stuff,  
which is independent of Rails. Anyway, getting a list of local deives  
would be a security violation. What are you ultimately trying to  
accomplish? Perhaps there’s another way to do it…

> If anyone know this pls send me the code.

We’re not here to do your job for you.

> Thanks & Regards,  
> Murwath Ali Mehtar.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 24, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/4 "2009-04-24T12:27:09Z")

</div>

Hi Marnen ,  
Thanks for the response u hav given . As i am working in ruby from past  
2 days . i am facing the difficulty . I dont require u to do my job . I  
am a java developer , its people like u who can help to move up in the  
technology . if u can help do it or else dont give any reply .

It will be much better

Thanks ,  
Ali

Marnen Laibow-Koser wrote:

> Murwath M. wrote:
> 
> > Hi All,
> > 
> > I had been assigned work of ruby on rails from two days . Using ruby on  
> > rails how do we get the list of drives present in a system ex : c:\ ,  
> > d:\ etc
> 
> Rails lives on the server side. You’re asking about client-side stuff,  
> which is independent of Rails. Anyway, getting a list of local deives  
> would be a security violation. What are you ultimately trying to  
> accomplish? Perhaps there’s another way to do it…
> 
> > If anyone know this pls send me the code.
> 
> We’re not here to do your job for you.
> 
> > Thanks & Regards,  
> > Murwath Ali Mehtar.
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 24, 2009, 6:23pm UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/5 "2009-04-24T18:23:42Z")

</div>

Murwath M. wrote:  
[…]

> I  
> am a java developer , its people like u who can help to move up in the  
> technology . if u can help do it or else dont give any reply .

I’m trying to help, but you’re kind of asking the impossible here. If  
you can answer my original question, I may be able to suggest something.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 24, 2009, 9:06pm UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/6 "2009-04-24T21:06:14Z")

</div>

Marnen Laibow-Koser wrote:

> Murwath M. wrote:  
> […]
> 
> > I  
> > am a java developer , its people like u who can help to move up in the  
> > technology . if u can help do it or else dont give any reply .
> 
> I’m trying to help, but you’re kind of asking the impossible here. If  
> you can answer my original question, I may be able to suggest something.
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

This is really turning out to be a great thread.

---

<div class="post-metadata">

**Author:** ![murwath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@murwath](https://www.ruby-forum.com/u/murwath)\
**Post date:** [April 24, 2009, 9:39pm UTC](https://www.ruby-forum.com/t/getting-list-of-drives-using-ruby-on-rails/166260/7 "2009-04-24T21:39:40Z")

</div>

Might want to try:

…  
mapped\_drives = `net use`.chomp.split  
…

or whatever the ms-windows shell command is that displays what drives  
have been mapped on the machine (note that I haven’t used ms-windows  
in over a decade or so, nor have access to test, …).

Jeff

On Apr 23, 12:08 am, Murwath M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
