Bug #9824 Updated: lack of bidirectional popen()

From: Date: Wed, 22 May 2002 11:10:19 +0000
Subject: Bug #9824 Updated: lack of bidirectional popen()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-8195@lists.php.net to get a copy of this message
ID: 9824 Updated by: jtoy@mac.com Reported By: morten@nilsen.com Status: Suspended Bug Type: Feature/Change Request Operating System: Linux 2.4.2 PHP Version: 4.0.4pl1 New Comment: please man popen on any BSD system. Until linux supports it?!?!?! Previous Comments: ------------------------------------------------------------------------ [2002-03-17 13:35:26] derick@php.net From the popen man page on Linux: DESCRIPTION The popen() function opens a process by creating a pipe, forking, and invoking the shell. Since a pipe is by definition unidirectional, the type argument may specify only reading or writing, not both; the resulting stream is correspondingly read-only or write-only. Suspending until Linux supports it. Derick ------------------------------------------------------------------------ [2002-03-17 13:32:18] phpbug@mrdrew.com I would also like to have a bidirectional popen. Currently, both myself and another poster on the popen page of idocs can only do this by creating two 'named' pipes on the fs. Then read and write to them. This is flawed though because of blocking on the named pipes by the readers/writers. *** oddly, if I popen('openssl', 'w'),write to it, then try to read from it then pclose() it spews the stdout from openssl into the browser. I was unable to assign this output to a variable either. Other posters at popen doc page seem to be trying to do this with popen('[some command]', 'r+') or 'w+', so this is definietly needed in PHP as it is in C. Sorry about the length. ------------------------------------------------------------------------ [2001-03-18 16:47:30] morten@nilsen.com I'm using php for shell scripting, and my current project is an indexer of smb shares. using shell commands (in this case smbclient) without the ability to interact, Creates a serious bottleneck, as it becomes neccessary to execute smbclient once for each folder on each share on each host on the network. well that's my two cents. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=9824&edit=1

« previous php.bugs (#8195) next »