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

mkdir returns false if directory already exists, so mkdirs has strange behavior

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_1

      Description

      In class java.io.File, the mikdir method seems to return false if
      the directory in questions already exists. This has two bad
      properties:

      (1) It is actually difficult to tell, after a call to mkdir, whether the
      directory exists, which is usually of greater interest than whether
      the transition from nonexistent to existent occurred.

      (2) As evidence of this, the value returned by mkdirs is almost
      useless. You actually expect one of the parent directories to exist;
      so mkdirs almost always returns false. If mkdir were to return true
      iff the directory exists after the call to mkdir, then mkdirs would return
      true iff the directory (and all its parents) exist after the call to mkdirs.

        Attachments

          Activity

            People

            • Assignee:
              tlindholsunw Timothy Lindholm (Inactive)
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: