createTempFile « API « Java I/O Q&A

1. Why does File.createTempFile return a symlink on Mac OS X?

I just found out that on Mac OS X the method File.createTempFile returns a symlink to a file, not an actual file. Does anyone know the reason for this behavior? (Context: ...

2. File.createTempFile() question

If this method returns successfully then it is guaranteed that: 1. The file denoted by the returned abstract pathname did not exist before this method was invoked, and 2. Neither this method nor any of its variants will return the same abstract pathname again in the current invocation of the virtual machine.

3. File.createTempFile naming problem

Hello All, I am using WIN XP .I am creating a temporary file with the following code File temporaryDll = File.createTempFile("abcd", ".dll"); In the temp directory , though I marked in code deleteOnExit to temporaryDll , it creates files with abcd1234.dll , abcd1235.dll n so on . The temp directory gets filled up with these number of dlls with diff suffix. ...

4. Creating Temporary files using the createTempFile function problem.

public void download( String fileUrl, File destination ) throws MalformedURLException,IOException { if (fileUrl != null && destination != null) { BufferedInputStream bis = null; BufferedOutputStream bos = null; try { URL url = new URL( fileUrl ); URLConnection urlc = url.openConnection(); bis = new BufferedInputStream( urlc.getInputStream() ); bos = new BufferedOutputStream( new FileOutputStream(destination.getName()) ); int i; while ((i = != ...

5. File.createTempFile naming problem