stderr, stdout, and errno 24
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Sat Jul 15 02:59:02 EDT 2006
In article <1152793219.333586.59410 at b28g2000cwb.googlegroups.com>,
"Wesley Henwood" <wesleyhenwood at hotmail.com> wrote:
>I've checked and double checked my code and I am closing all files
>explicitly after opening them.
If you're running your program under Linux, a very easy way to confirm
this is to look in the directory
/proc/<pid>/fd
where <pid> is the PID of your running program. In here you will see a
symlink to every file your program has open, the name of the link being
the file descriptor number.
To make it easier to watch, you may want to stick in a sleep of a few
seconds in-between iterations of the code that executes the Python
script.
If you see the entries piling up in this directory, that will confirm
that you're not closing those files.
More information about the Python-list
mailing list