views:

19

answers:

1

Hi

mount
/project on /mount_1 type none (rw,bind)
/project on /mount_2 type none (rw,bind)
/project on /mount_3 type none (rw,bind)

How to check with ruby(not shell!!) if some dir is mounted on /mount_X?

Is there something easier then opening /proc/mounts and looking for /mount_X there?

A: 

You can just parse the output of the mount command:

`mount`.split("\n").grep(/bind/).map { |x| x.split(" ")[2]  }
floatless