I’m trying to play with LCD4Linux
There is fascility from LCD4Linux that let it to read to a file, and
the LCD with the content of file being read.
For a dirty trial , I use a Curse driver for LCD4Linux display.
It emulate 4 line LCD
I made 4 file , each intended for each line of the LCD
Next , I wrote simple BASH script below :
echo $b >$f
if [ “$a” -eq 4 ]
Let the script run.
While the script run … I open 2nd console
And from that last console I run lcd4linux … and find that it work
like what I want.
LCD4Linux read the file … and display the content perfectly.
I tried to do it with ruby :
irb(main):001:0> my_file = File.new("/mnt/ramdisk0/line3",
irb(main):004:0* my_file.puts “write it”
The LCD4Linux can not read the file … so it can not display the content
But, when I try :
And back to my main Shell … LCD4Linux can read the file and display
2 Question :
- How to make rubby to do shared file access ?
- the file.puts command always write to the end of the file, How to
ruby just overide the content of the file with it’s output ?
(just like bash ==> echo “something” >./thisfile )