Ruby and popen

C

commo

Hi, I am a new programmer, very new to ruby. I am creating a windows
front end to rsync, and I am having some issues, I have read alot of the
net and can't seem to find a solution.

Here is the problematic function:

def rsync_files()
String command="rsync --verbose --stats --progress -r
--rsh=c:/ruby/bin/ssh" + @filenames + "(e-mail address removed):/home/myuser"
rsync = IO.popen(command, "w+")
inctxt=""
begin
print(inctxt)
@statustextbox.append_text(inxtxt)
inctxt=rsync.gets
end while inctxt!=nil
end

Pretty much it sends the proper rsync command and everything works, but I
dont get any feedback from the program untill rsync finishes it. I figure
that the stdout buffer isnt full so it doesent send any info untill the
program finishes. I can find a way to flush the buffer.

Any help would be great.

--Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top