Description
What should happen if File.createTempFile("qwe", "rty", "/non-existent");
By one hand there is followiong throws clause:
---------------------------------------
Throws:
IOException - If a file could not be created
---------------------------------------
And it seems that conventional implemntations like JDK on Linix/Windows/Solaris behave exactly in this way.
By other hand some platform may have native level system calls with similar functionality creating intermediate directories if necessary.
It is not clear if they have to be forced to throw IOE in such case or not.
From my standpoint spec should say that in case of the absend base directory there are two options:
* avoid temp file creation and throw IOE
* create temp file together with intermediate directory and throw nothing.
And selection of the appriate one is up to the implementation.
By one hand there is followiong throws clause:
---------------------------------------
Throws:
IOException - If a file could not be created
---------------------------------------
And it seems that conventional implemntations like JDK on Linix/Windows/Solaris behave exactly in this way.
By other hand some platform may have native level system calls with similar functionality creating intermediate directories if necessary.
It is not clear if they have to be forced to throw IOE in such case or not.
From my standpoint spec should say that in case of the absend base directory there are two options:
* avoid temp file creation and throw IOE
* create temp file together with intermediate directory and throw nothing.
And selection of the appriate one is up to the implementation.
Attachments
Issue Links
- duplicates
-
JDK-4847239 (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory
- Resolved