'popen' command under WinXP

From: Date: Fri, 01 Mar 2002 20:16:35 +0000
Subject: 'popen' command under WinXP
Groups: php.windows 
Request: Send a blank email to php-windows+get-12390@lists.php.net to get a copy of this message
I am currently trying to get some php code working that was originially written to run under UNIX. I have a problem though. The function 'popen' doesn't seem to want to work. Here is the code snipet: $command = $CVS->conf['paths']['rcsdiff'] . " $options -r$rev1 -r$rev2 '$fullName' 2>&1"; if (!($diffStream = popen($command, 'r'))) { return false; } else { while ($line = fgets($diffStream, 4096)) { $diff[] = rtrim($line); } return $diff; } I have confirmed that $command is properly set and I also realize that WinXP has no idea what "2>&1" means. I have tried altering the command as such: $command = "cmd /K \"" . $CVS->conf['paths']['rcsdiff'] . " $options -r$rev1 -r$rev2 '$fullName'\""; and also: $command = "command.com /C \"" . $CVS->conf['paths']['rcsdiff'] . " $options -r$rev1 -r$rev2 '$fullName'\""; however neither appear to be producing a stream for me. I don't want to be returning false. I need it to capture the output from the command. First off, is there a way to get popen to work in WinXP? If not, is there a way to rewrite this code to capture the output from this command? I am currently running PHP 4.1.1 on Apache 1.3.23. Thank you in advance for any help. -- Chris Haidvogel Software Engineer Videk, Inc. 2200 Brighton Henrietta Town Line Rd. Rochester, NY 14623 Phone: (716) 292-6210 Fax: (716) 292 5884 E-mail: cph@videk.com

« previous php.windows (#12390) next »