"Barkster" <bdog4@hotmail.com> wrote in news:1148334332.450198.40590
@u72g2000cwu.googlegroups.com:
> I'm having an app developed for me and they are storing the files in a
> newly created folder on the C: drive but I don't want to make directory
> there. Is there not a way to get the temp variable for machine, like
> %temp or %tmp? Thanks
( http://www.rgagnon.com/javadetails/java-0484.html )
String tempdir = System.getProperty("java.io.tmpdir");
if ( !(tempdir.endsWith("/") || tempdir.endsWith("\\")) )
tempdir = tempdir + System.getProperty("file.separator");
Bye.

Signature
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html
Chris Smith - 23 May 2006 00:58 GMT
> String tempdir = System.getProperty("java.io.tmpdir");
Or File.createTempFile is often better, depending on the situation.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Barkster - 23 May 2006 02:36 GMT
Thanks guys, I think my devoloper just copied some code over I would
hope he would have know this. Appreciate it.
Barkster - 23 May 2006 02:38 GMT
Does this work on win and mac? Thanks
Steve W. Jackson - 23 May 2006 22:02 GMT
> Does this work on win and mac? Thanks
It works with all platforms. The java.io.tmpdir property tells you
where the JVM will store temporary files and is set by the
implementation.

Signature
Steve W. Jackson
Montgomery, Alabama
Barkster - 23 May 2006 22:56 GMT