> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Andy > Smelt > Sent: Sunday, July 31, 2005 4:25 PM > To: activeperl@listserv.ActiveState.com > Subject: Problem reading output from an executable. > > > Help! > > I'm trying to automate (on Wondows Server) a file > restore using (Legato Networker) recover.exe. > > I'm using OPEN, piping the o/p of the command to a > file handle and then WHILEing it. When the command is > run from a command prompt it keeps the user informed > of its progress. Stuff like "Looking for file, this > may take a while..." etc. > > The lines are displayed in the console as it goes, > pausing between lines. BUT when redirected to a file > handle, the command doesn't return anything until it's > finished so the script just doesn't get to the WHILE > until the recover has completed and all the o/p is > returned in one lump. The same happens if I run > recover.exe from the command line and redirect the o/p > to a file. The file appears when the command starts > but none of the o/p goes into the file until the > recover has finished. Also I have found that the o/p > only appears in the file if I do a 2>&1 so the command > is using STDERR for normal o/p. > > Any ideas? Is the command holding back its o/p or is > Windows just not writing to the file until it closes > it? How can I get my Perl script to "watch" the o/p of > the command as it happens. > > Any suggestions gratefully received. >
Try $|++; HTH - Lynn. _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs