Is there a library for getting information in drives that can be mounted and
can then mount or unmount those drives in Linux/Unix, I can write my
program to read the /etc/fstab file but then I would have to go to extra
trouble to find out if the drives are mounted or not so I would preffer
having a library to do the work for me.
anonimous wrote:
Is there a library for getting information in drives that can be mounted
and can then mount or unmount those drives in Linux/Unix, I can write my
program to read the /etc/fstab file but then I would have to go to extra
trouble to find out if the drives are mounted or not so I would preffer
having a library to do the work for me.
I’m not getting any replies so I’ll try explaining what I am asking again in
case the silence is related to people not understanding what I was asking.
Basically what I would like to know is if there is a ruby library or
extension for the mount command in Linux, I also need it to be able to get
information on the drives that can be mounted.
anonimous wrote:
I’m not getting any replies so I’ll try explaining what I am asking again in
case the silence is related to people not understanding what I was asking.Basically what I would like to know is if there is a ruby library or
extension for the mount command in Linux, I also need it to be able to get
information on the drives that can be mounted.
See what happens if you search the Ruby Application Archive
(http://raa.ruby-lang.org) for the keyword “mount”.
/etc/fstab are the drives that can be mounted
/etc/mtab are the drives that ARE mounted.
Sam
Quoteing n.thomp@roadrunner.nf.net, on Wed, Mar 12, 2003 at 05:32:17AM +0900:
···
anonimous wrote:
Is there a library for getting information in drives that can be mounted
and can then mount or unmount those drives in Linux/Unix, I can write my
program to read the /etc/fstab file but then I would have to go to extra
trouble to find out if the drives are mounted or not so I would preffer
having a library to do the work for me.I’m not getting any replies so I’ll try explaining what I am asking again in
case the silence is related to people not understanding what I was asking.Basically what I would like to know is if there is a ruby library or
extension for the mount command in Linux, I also need it to be able to get
information on the drives that can be mounted.
Lyle Johnson wrote:
anonimous wrote:
I’m not getting any replies so I’ll try explaining what I am asking again
in case the silence is related to people not understanding what I was
asking.Basically what I would like to know is if there is a ruby library or
extension for the mount command in Linux, I also need it to be able to
get information on the drives that can be mounted.See what happens if you search the Ruby Application Archive
(http://raa.ruby-lang.org) for the keyword “mount”.
I found something that I think will tell me if a certain folder is a mounted
device, but there was nothing there for extracting the information from
/etc/fstab , I’d write something for it myself but I am a newbie at Ruby
and I’ve only read tutorials so far os I don’t know much yet. I find it
easier to learn from books, its much easier to read when the text is on
paper rather then on a monitor.
anonimous wrote:
I found something that I think will tell me if a certain folder is a mounted
device, but there was nothing there for extracting the information from
/etc/fstab.
If you search the RAA for the keyword “mount”, one of the few matches is
for the “FileSystem” extension:
http://raa.ruby-lang.org/list.rhtml?name=filesystem
If you download, build and install this extension, you can then write a
little script like this one to extract information from /etc/fstab:
require 'filesystem'
FileSystem.mounts("/etc/fstab") { |m|
puts m.device
puts m.mount
puts m.fstype
puts m.options
puts m.dump_interval
puts m.check_pass
puts "----------------------"
}
HTH,
Lyle