Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6722262

(spec) File.createTempFile(String, String, File) should make it clear that the directory is not created

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • tbd
    • 6
    • core-libs
    • x86
    • linux

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sreznick Sergey Reznick (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: