News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
real time activity
Author Message
ceeuu
Junior Member
**


Posts: 9
Group: Registered
Joined: Jul 2008
Status: Offline
Reputation: 0
Post: #1
real time activity

Got a question...
I'm trying to gather the output of a system command and display it in a browser object, however, if the command takes a while the window will not appear (with the browser object in it) until the command is complete.. even-though the command is producing output. Actually the output window will start to appear, depending on the command, but won't fully paint. For example doing a ping or traceroute and showing the output as it is produced. Is there a better/recommended way to do this:

function execute_cmd()
local fh = io.popen( cmd );
if ( fh ) then
output_window:show();
while true do
local data = fh:read( "*l" );
if data == nil then break end
br_output:add( data );
output_window:redraw();
br_output:redraw();
end
fh:close();
end
end

Thanks,
-Craig

01-19-2010 03:26 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
real time activity - ceeuu - 01-19-2010 03:26 AM
RE: real time activity - mikshaw - 01-19-2010, 04:28 AM
RE: real time activity - JohnMurga - 01-20-2010, 07:35 AM
RE: real time activity - ceeuu - 01-22-2010, 04:12 AM
RE: real time activity - ceeuu - 01-22-2010, 05:05 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: