Re: Read From COM1 port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kim Madsen wrote:
> I'm having trouble reading from COM1, writing works like a charm but I'd
> like to be able to read the output from a switch or a router in order to
> determine that the command was successful and the configuration actually
> went fine :-)
>
> doing:
>
> $fp = fopen("COM1", "rwb");

You might try this:

$input = fopen("COM1", "rb");
$output = fopen("COM1", "wb");

Use $output to write, and $input to read.

Another possibility would be to check the manual...

I don't thing 'rwb' is the correct way to fopen for read/write access.

'wb+' would be a better answer, I think.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux