lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6914] New: - Problem creating directories for FSDirectory
Date Wed, 06 Mar 2002 12:17:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6914>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6914

Problem creating directories for FSDirectory

           Summary: Problem creating directories for FSDirectory
           Product: Lucene
           Version: CVS Nightly - Specify date in submission
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Store
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: luispenya@aqs.es


There is a problem when you try to create a directory (FSDirectory) that doesn't exists and
you 
specified a path with a depth greater than 1.

For example: lucia/index/

The problem 
lays on the method
  private synchronized void create() throws IOException {
    if 
(!directory.exists())
      directory.mkdir();   <======== HERE SHOULD BE mkdirs();

    
String[] files = directory.list();            // clear old files
    for (int i = 0; i < files.length; i++) {
      
File file = new File(directory, files[i]);
      if (!file.delete())
        throw new 
IOException("couldn't delete " + files[i]);
    }
  }

Regerds

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message