|
-
Nov 6th, 2008, 05:09 PM
#1
Thread Starter
Hyperactive Member
Clearing temp directory question
I am creating what could amount to quite a few temp files on a terminal server using the System.IO.Path.GetTempPath. My question is this. Can I trust Windows to clear that directory on a regular basis or do I need to clear it in code?
-
Nov 6th, 2008, 05:43 PM
#2
Re: Clearing temp directory question
 Originally Posted by FastEddie
I am creating what could amount to quite a few temp files on a terminal server using the System.IO.Path.GetTempPath. My question is this. Can I trust Windows to clear that directory on a regular basis or do I need to clear it in code?
Windows will never clear the temp folder. How does the OS know when those files are no longer needed? It's every application's responsibility to clear its own temp files.
-
Nov 6th, 2008, 09:57 PM
#3
Thread Starter
Hyperactive Member
Re: Clearing temp directory question
Oh I always thought Windows did periodic clean up in the temp directory. Now I am not sure how I am going to remove the files after use. My problem is that the user can keep open the file long after the application is closed.
-
Nov 6th, 2008, 10:07 PM
#4
Re: Clearing temp directory question
Maybe ApplicationData would be a better location than Temp then.
-
Jan 27th, 2009, 07:48 PM
#5
Addicted Member
Re: Clearing temp directory question
JMc,
Would you mind explaining your answer a little bit more?
I also have an application that generates files (PDF files in my case) and the user may or may not have the files open when they exit my program.
What can we do with ApplicationData to enable better control over these files? Then, how (when) do we delete files later?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|