Forum: Ruby find type of filesystem (*nix/windows)

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.
Bde9493348770b4f6bf0f632ef91fc1c?d=identicon&s=25 Ittay Dror (ittayd)
on 2008-11-19 11:36
(Received via mailing list)
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
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 Glen Holcomb (Guest)
on 2008-11-19 15:58
(Received via mailing list)
On Wed, Nov 19, 2008 at 3:32 AM, Ittay Dror <ittay.dror@gmail.com>
wrote:

> --
> --
> Ittay Dror <ittay.dror@gmail.com>
>
>
>
>
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)
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (djberg96)
on 2008-12-30 18:49
(Received via mailing list)
On Nov 19, 3:32 am, Ittay Dror <ittay.d...@gmail.com> 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
This topic is locked and can not be replied to.