On 12/13/06, Arí Ricardo Ody <[EMAIL PROTECTED]> wrote:
I'm developing little application for compress/uncompress data using
tarball or Zip with a graphical front end.
When I submit a tarball command with an error via TProcess I am not
receiving the same messages that appear in the screen when I type the
same tarball command via linux konsole.
Hello Ari,
Well, all the programs have 3 standard files : input, output and
error. The 'standard
error' is usually used for writing errors, warnings and other messages.
The standard error is different from the standard output because it is
desirable that
the messages (which could be just warnings or debugging messages)
don't pollute the
program's output. Also, a separate standard error allows a program to have its
output redirected through a pipe , and at the same time write
progress information
on the screen.
When you run a program from the command line : both 'standard output' and
'standard error' are associated to the screen (console).
But when calling the same program with TProcess , the program's output will
be separated : some data go to TProcess.Output , and some other data go to
TProcess.StdErr .
You have two options:
- add the poStderrToOutPut to the Options of your TProcess object
. This will tell
TProcess to "Redirect standard error to the standard output stream".
- or, read the messages from TProcess.StdErr similarly to how you read from
TProcess.Output .
The second option is probably better .
I sent an e-mail to this mailing list with the source of the
procedure where I'm trying to catch the tarball output via
TProcess.Output. No one answer my e-mail. No problems, I'm not complaining.
In my example, the length of messages generated in the konsole is
less than 2kb, the length of linux Pipe. I suppose that I'm not
losing data by this way.
I'm writing to ask if someone knows some place where I can get more
information about this matter.
Please.
Greetings from Sao Paulo - Brazil
Ricardo
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
--
Adrian Maier
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives