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.
|