5 messages in com.perforce.perforce-user[p4] Why does 'p4 add' put its errors...
FromSent OnAttachments
Schmidgall, Jay03 Jan 2002 13:49 
Robert Cowham04 Jan 2002 01:32 
Maurice Meyer04 Jan 2002 10:01 
Rick Macdonald04 Jan 2002 10:50 
Robert Cowham04 Jan 2002 15:47 
Subject:[p4] Why does 'p4 add' put its errors on stdout and not stderr?
From:Maurice Meyer (maur@openwave.com)
Date:01/04/2002 10:01:52 AM
List:com.perforce.perforce-user

You may have already tried this or discounted it for other reasons but there is the -s option:

The -s flag causes the p4 client program to prefix each line of output with a tag (error, warning, info, text, exit) so as to make it amenable to scripting.

Perhaps the tagging gets it right even if it's not sent to STDERR.

Maurice

-----Original Message----- From: perf@perforce.com [mailto:perforce-user-admin at perforce.com]On Behalf Of Robert Cowham Sent: Friday, January 04, 2002 1:33 AM To: perforce-user at perforce.com Subject: RE: [p4] Why does 'p4 add' put its errors on stdout and not stderr?

Report it to support. Error handling in Perforce (for scripts etc) is not easy (nor always consistent in my experience/opinion as this example shows). You need to parse the output for all cases and work out how to deal with them.

I hear rumours from time to time that they are looking at improving it, but I am sure it's not a straight forward job.

-----Original Message----- From: perforce-user-admin at perforce.com [mailto:perforce-user-admin at perforce.com]On Behalf Of Schmidgall, Jay Sent: Thursday, January 03, 2002 09:50 To: perforce-user at perforce.com Subject: [p4] Why does 'p4 add' put its errors on stdout and not stderr?

I just got bit by a case sensitivity issue between our Unix dev box and our Windows Perforce server.

Although case sensitivity was the underlying cause, the error would have been detected had 'p4 add' issued the warning:

//depot/bar.java - can't add existing file

to stderrr rather than to stdout, as say 'p4 edit' does.

Is there a particular reason why p4 add doesn't send its errors to stderr?

: jay