<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109535</guid>
        <pubDate>Wed, 03 Jul 2002 10:08:03 +0000</pubDate>
        <title>Помогите! В Линухе read() читает не файл а клаву</title>
        <link>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109535</link>
        <description><![CDATA[Devilray: Ошибка в том, что в строке if(fdesc = open(argv[1], O_RDONLY) == -1) выражение fdesc = open(argv[1], O_RDONLY) НЕ ВЗЯТО В СКОБКИ !!!!!!!!!! В твоем случае fdesc == 0 что соответствеет stdin == как правило клавиатура.]]></description>
        <author>Devilray</author>
        <category>*nix</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109534</guid>
        <pubDate>Fri, 14 Jun 2002 05:37:22 +0000</pubDate>
        <title>Помогите! В Линухе read() читает не файл а клаву</title>
        <link>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109534</link>
        <description><![CDATA[bin: ответ в форуме &quot;С/С++&quot;]]></description>
        <author>bin</author>
        <category>*nix</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109533</guid>
        <pubDate>Thu, 13 Jun 2002 13:23:34 +0000</pubDate>
        <title>Помогите! В Линухе read() читает не файл а клаву</title>
        <link>https://forum.sources.ru/index.php?showtopic=12349&amp;view=findpost&amp;p=109533</link>
        <description><![CDATA[ATar: Есть код:<br><br> &nbsp; int fdesc, readedBytes;<br> &nbsp; char buf[5000];<br> &nbsp; ...<br> &nbsp; if(fdesc = open(argv[1], O_RDONLY) == -1)<br> &nbsp; {<br> &nbsp; &nbsp; &nbsp;perror(&quot;file open&quot;);<br> &nbsp; &nbsp; &nbsp;return -1;<br> &nbsp; }<br> &nbsp; if((readedBytes = read(fdesc, &amp;buf, 5000)) == -1)<br> &nbsp; {<br> &nbsp; &nbsp; &nbsp;perror(&quot;file read&quot;);<br> &nbsp; &nbsp; &nbsp;close(fdesc);<br> &nbsp; &nbsp; &nbsp;return -1;<br> &nbsp; }<br><br>В результате read читает не файл, а ввод с клавы. В дебагере проверял - argv[1] стоит правильно, файл такой есть, права нормально и т.д.<br>Никто не подскажет, чё за хрень происходит?<br>Заранее спасибо.]]></description>
        <author>ATar</author>
        <category>*nix</category>
      </item>
	
      </channel>
      </rss>
	