On Thu, Jan 18, 2007 at 05:17:50PM -0500, Adam wrote:
> Why does fopen()ing a directory for reading succeed instead of failing
> with EISDIR?  This has the possibly unexpected consequence of letting
> you pass yyin to yylex() as a fopen()ed directory, which then thinks it
> finished successfully because fread() returns 0 immediately.

Directories are files and can be open(2)ed as such for reading. Trying
the same for writing *should* give EISDIR.
-- 
Darrin Chandler            |  Phoenix BSD Users Group
[EMAIL PROTECTED]   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |

Reply via email to