I came across an other problem with ruby-gnome 0.16.
Reading files from the sysfs under linux seems impossible. Here is a
sysdir = ‘/sys/class/video4linux’
sysentries = Dir.new sysdir
sysentries.each do |s|
if s != ‘.’ and s != ‘…’ and File.directory?(sysdir + ‘/’ + s)
name_file = sysdir + ‘/’ + s + ‘/name’
if File.exist?(name_file) and File.readable?(name_file)
p File.new(name_file, “r”).gets.chomp
sensor_file = sysdir + ‘/’ + s + ‘/sensor’
if File.exist?(sensor_file) and File.readable?(sensor_file)
p File.new(sensor_file, “r”).gets.chomp
It looks if a video camera is connected and prints its name or the used
sensor. To the line where the file is opened ( File.new(name_file,
“r”) ) it works well. But in the “gets” method it hangs.
If i comment out the requiring of gtk2, or try to read from a regular
file it works like expected.
With ruby-gnome 0.14.* it gave no problems.
Ps. big thanks to Kouhei S. for the fast fix of the libglade problem!
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
opinions on IT & business topics through brief surveys - and earn cash