In article <[email protected]>,
Steven D'Aprano <[email protected]> wrote:
> there is no way to create a C file descriptor in a closed state. Such
> a thing does not exist. If you have a file descriptor, the file is
> open. Once you close it, the file descriptor is no longer valid.
Of course there is.
int fd = 37;
I've just created a file descriptor. There is not enough information
given to know if it corresponds to an open file or not.
Before you protest that "it's just an int, not a file descriptor", I
should point out that they're the same thing. It's pretty common to do
something like:
for (int fd = 0; fd <= MAX_FD; fd++) {
close(fd)
}
before forking, to make sure all file descriptors are closed.
--
http://mail.python.org/mailman/listinfo/python-list