You are here: Re: [PHP] Read From COM1 port « PHP « IT news, forums, messages
Re: [PHP] Read From COM1 port

Posted by Richard Lynch on 03/03/05 21:56

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация