[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua bug - loadfile gets stdin confused
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 18 Apr 2007 22:31:30 -0300
> Not probably - File descriptors are assigned starting with the
> smallest available. Closing stdin and immediately opening a new
> file is guaranteed to use file descriptor 0.
You're right. My point was that some implementations, including Mac OS X,
not only recycle file descriptors in the UNix tradition, but also recycle
FILE* and so the newly opened file will "be" stdin!
This is from /usr/include/stdio.h in Mac OS X 10.4:
#define stdin (&__sF[0])
--lhf