Connecting Tech Pros Worldwide Forums | Help | Site Map

File Deletion Problems

jaws
Guest
 
Posts: n/a
#1: Jul 23 '05
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?

John




Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 23 '05

re: File Deletion Problems


"jaws" <john.armsby@mindspring.com> wrote...[color=blue]
> My problems is as follows. Hope you guys can provide some insight.
> [...]
>
> Of course the big difference is I am now in a 2-processor environment....
>
>
> Any ideas?[/color]

Convert your description to read more like a C++ language problem, then
perhaps we'll be able to help. Multiprocessor environment, CGI, Apache
2.0, Web browsers, threading, Unix cron, are all off-topic here.

V


Larry Brasfield
Guest
 
Posts: n/a
#3: Jul 23 '05

re: File Deletion Problems


"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.


jaws
Guest
 
Posts: n/a
#4: Jul 23 '05

re: File Deletion Problems


jaws wrote:

thanks for the input. I will post elsewhere. Sorry for the inconvenience.
Perhaps I can find a group that can tell me what happens to an object and
its destructor in a CGI environment. BTW I move everything to the
destructor (C++ related here) works fine until the process is killed by the
web browser.

Regards,


[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?
>
> John[/color]

Closed Thread