in order to get the answer of rsync when doing a backup with ruby, i
make use of IO.pope like that :
f = IO.popen("#{RSYNC} -a#{verboseStr} #{progressStr} --eahfs
“#{i.path}” “#{@usbkey.stringValue.to_s}”", “r”)
while( r = f.gets ) do
log( “#{r}” )
end
it works but not the way i’d like to get.
if i do :
#{RSYNC} -a#{verboseStr} #{progressStr} --eahfs “#{i.path}”
“#{@usbkey.stringValue.to_s}”
on a terminal, i get each line, given by rsync, at a time thru Ruby it
isn’t exactly the same, i get the whole lines at a time, thought i’d
prefer one after each other avoiding the user to be bored, because it
sees something …
may be i’m wrong somewhere with this part :
while( r = f.gets ) do
log( “#{r}” )
end
???