We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › get temp folder of system or user
Page Index Toggle Pages: 1
get temp folder of system or user (Read 845 times)
get temp folder of system or user
Nov 28th, 2008, 9:05am
 
Hi,

how can I get the temp folder from the system (eg. C:\windows\temp) or the current user (C:\documents...\temp) or all user?

common: how do I access (get) system specific variables?

regards,
walter
Re: get temp folder of system or user
Reply #1 - Nov 28th, 2008, 11:10am
 
On windows it's stored in the environment variable TMP or TEMP I believe, and can be accessed with:

String tmp=System.getenv("TMP");

On unix I think you have to just assume /tmp is the temp directory
Re: get temp folder of system or user
Reply #2 - Dec 8th, 2008, 7:22pm
 
A more consistent way is to simply ask the runtime, via :
System.getProperty("java.io.tmpdir");

Or, if you simply want a temporary directory that can be cleaned up, File has a static method to create tempdirs.
Page Index Toggle Pages: 1