Error: Too many open files

During my development I am using testing (CUnit) to exercise my classes.
The class I am testing launches and terminates processes and then opens
their file configuration files to determine what name they registered for
verification that they are running. I am running the test 300 times (3
processes launched 100 times and verified). When I reach the 85th iteration
of launching the processes, I receive the error: “Too many open files”. I
am using ifstream to read the files into a string and then I close the
stream. I have verified that there is no way that the stream would not get
closed (the read is encapsulated into a method that performs error checking
and catches all exceptions). Is there something that I need to do other
than close the stream for the OS to know that the file descriptors are no
longer in use?

Your help is greatly appreciated,

Kevin Hykin

Try closing the fd returned from the name_open() calls (then buy me some
beer for helping you)



“Kevin Hykin” <kevin.hykin@bepco.com> wrote in message
news:9lgpqc$3t9$1@inn.qnx.com

During my development I am using testing (CUnit) to exercise my classes.
The class I am testing launches and terminates processes and then opens
their file configuration files to determine what name they registered for
verification that they are running. I am running the test 300 times (3
processes launched 100 times and verified). When I reach the 85th
iteration
of launching the processes, I receive the error: “Too many open files”. I
am using ifstream to read the files into a string and then I close the
stream. I have verified that there is no way that the stream would not
get
closed (the read is encapsulated into a method that performs error
checking
and catches all exceptions). Is there something that I need to do other
than close the stream for the OS to know that the file descriptors are no
longer in use?

Your help is greatly appreciated,

Kevin Hykin