Hi
I've been trying to change zenity_scale so that when using
print-partial, it reads the value while changing the bar instead of
simply get all values in the end. However, I can't read the values
from the pipe correctly. From reading the help text, I think it should
return -1 when it has read everything but instead, octave just hangs.
This should replicate it:
octave-3.2.4 > fid = ("zenity --scale --print-partial", "r")
## adjust bar to value 16
## adjust bar to value 24
octave-3.2.4 > fgets(fid)
ans = 16
octave-3.2.4 > fgets(fid)
## octave hangs here
## adjust bar to value 46
ans = 24
octave-3.2.4 > fgets(fid)
## octave hangs here
## press OK on the zenity dialog
ans = 46
By experimenting in a terminal (and by setting fgets to read only one
character at a time), I can see that zenity does print the number as
soon as the bar is adjusted and not after the next one is selected.
This shows that the number is in the pipe, and what makes octave
hangs, in whatever comes after the last digit.
octave-3.2.4 > fid = ("zenity --scale --print-partial", "r")
## adjust bar to value 16
octave-3.2.4 > fgets(fid,1)
ans = 1
octave-3.2.4 > fgets(fid,1)
ans = 6
octave-3.2.4 > fgets(fid,1)
## octave hangs here instead of returning -1
Is this a bug in fgets, zenity or in my code? Any help is very appreciated.
Thanks in advance
Carnë Draug
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev