Re: Launching a file properly
| From: | Lars Torben Wilson | Date: | Fri, 13 Oct 2000 06:00:36 +0000 |
| Subject: | Re: Launching a file properly | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19945@lists.php.net to get a copy of this message | ||
Chris Aitken writes:
> I have a bit of a problem.
>
> I am needing to launch a program from a php script. This I can do with the
> following code
>
> $fp = popen("/usr/local/bin/minicom -stuff", "w+");
> pclose($fp);
>
> Now Minicom launches properly, contacts the serial port and does everything
> properly, but then gets caught up in a major loop. If I run top, it shows
> minicom just chewing up the CPU until I kill it off.
>
> Am I missing something, or doing something wrong.
>
> If I run the command from the command line, it runs perfectly, does its
> deed and exits minicom (its all in my minicom script), but doing it from
> the above code still allows it to do its deed, but wont kill off minicom
> once its finished and it just loops into oblivion.
>
>
> Any assistance would be muchly appreciated.
>
>
> Thanks
>
>
> Chris
Are you really needing to write to minicom's stdin? If you don't
really *need* popen() here, what happens when you use exec(),
system(), or backticks?
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+