# Find type of filesystem (\*nix/windows)

**URL:** <https://www.ruby-forum.com/t/find-type-of-filesystem-nix-windows/153610>\
**Category:** Ruby\
**Created:** [November 19, 2008, 11:36am UTC](https://www.ruby-forum.com/t/find-type-of-filesystem-nix-windows/153610 "2008-11-19T11:36:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ittayd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/54ee81/32.png) [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Post date:** [November 19, 2008, 11:36am UTC](https://www.ruby-forum.com/t/find-type-of-filesystem-nix-windows/153610/1 "2008-11-19T11:36:38Z")

</div>

How can I find in ruby the type of filesystem from a given file? (pseudo  
code: FileSystem.type(’/path/to/file’)). I’m especially interested to  
know if the fs is networked (nfs, cifs) or on a local disk.

Thank you,

Ittay

---

<div class="post-metadata">

**Author:** ![ittayd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/54ee81/32.png) [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Post date:** [November 19, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/find-type-of-filesystem-nix-windows/153610/2 "2008-11-19T15:58:35Z")

</div>

On Wed, Nov 19, 2008 at 3:32 AM, Ittay D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## –
> 
> Ittay D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

I would just ask the system:

currently\_mounted = `mount`

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![ittayd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/54ee81/32.png) [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Post date:** [December 30, 2008, 6:49pm UTC](https://www.ruby-forum.com/t/find-type-of-filesystem-nix-windows/153610/3 "2008-12-30T18:49:01Z")

</div>

On Nov 19, 3:32 am, Ittay D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How can I find in ruby the type offilesystemfrom a given file? (pseudo  
> code:FileSystem.type(‘/path/to/file’)). I’m especially interested to  
> know if the fs is networked (nfs, cifs) or on a local disk.

gem install sys-filesystem

Enjoy!

Dan
