Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

significant change to how run-tests works - is it OK?
Hi,

I just encountered one problem with run-tests - it uses backticks to
execute tests, like so:

$out = `$cmd`;

This is great for almost all situations.  Unfortunately, in very rare
cases, it is also necessary to test for return values.  For instance,
the shell-test command returns 1 or 0 - this is the only way to test its
output (by design).

Fortunately, by changing the code above to:

ob_start();
system($cmd, $return_value);
$out = ob_get_contents();
ob_end_clean();

it's possible to retrieve the return value and test based on it.
Otherwise, I will have to somehow run a test-within-a-test, which would
suck.

My question is: are there any situations that anyone knows of where
system() just doesn't measure up to the flexibility of shell_exec()?

Greg

Report this thread to moderator Post Follow-up to this message
Old Post
Greg Beaver
11-27-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP PEAR Questions and Answers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:40 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.