- In each user directory under AppData\Local\Temp\ This may change depending Windows version?
- In the system folder under Temp\ (C:\Windows\Temp)
The locations are stored in system variables. Some frameworks (.NET, VB6 and no doubt others) give you convient ways to find the paths rather than having to look up the system variable (e.g. System.IO.Path.GetTempPath in .NET).
Windows does not clean up the temporary folder for you (which is why it's worth blasting out old files it every few months on your own machine), it's up to you to play nice. Create a file or files unlikely to step on the names any other software is using (they should take care to do the same, and so any name should do, but it's always good to assume the worse of other code on the system), and delete files when you're done (or on application exit at least).
In .NET System.IO.Path.GetTempFileName() will create a new file in the temp area and return the name of it to you, that is reasonably guaranteed not to conflict with others' so use that or similar methods if you can.
Read full article from Windows temp directory details (Java) - Stack Overflow
No comments:
Post a Comment