"jaws" <john.armsby@mindspring.com> wrote in message
news:VPZYd.8137$oO4.4296@newsread3.news.pas.earthl ink.net...[color=blue]
> My problems is as follows. Hope you guys can provide some insight.
>
> 1. I have a class which opens a file and simply spits out the text.
> Methods in place to open, print, close, and delete the file.
>
> 2. This class is instantiated as a thread, I have several acting on
> different files.
>
> 3. The application is web based. The user can kill the app. from the
> browser, effectively leaving my temp files undeleted because the app can
> end before it invokes the file close and file delete methods. This rarely
> happens as the file is opened, read, and closed within seconds. I have a
> unix cron to do tempfile cleanup once a day. I may see one or two tempfiles
> hanging around during a 24 hour period before being deleted by the cron
> job.
>
> 4. I moved the application to a multi processor environment. I am now
> seeing a pretty big increase in the temp files hanging around in the
> directory.
>
> 5. I am thinking I might be better off invoking the file close and deletion
> of temp file in the destructor. Previously the destructor was empty.
>
> 6. I am running this app with Redhat Linux as the OS. Apache 2.0 is the web
> server. App runs as CGI.I find it hard to believe that users are killing
> the app from theb rowser often enough to leave the temp files hanging
> around. I have tried to simulate the app kiling and can not reproduce the
> problem.
>
> Of course the big difference is I am now in a 2-processor environment....
>
> Any ideas?[/color]
Victor is right about this being off-topic. But
before you take it somewhere else, you may
want to clarify what is consuming the file and
whether you error-check the close attempt.
(It may well fail if there is another process
with the file open for read. If there is not,
then I would question the decision to use a
temporary file.)
A good forum for general programming problems
such as your is comp.programming .
Good luck!
--
--Larry Brasfield
email:
donotspam_larry_brasfield@hotmail.com
Above views may belong only to me.