Index: src/java/org/apache/lucene/store/SimpleFSDirectory.java =================================================================== --- src/java/org/apache/lucene/store/SimpleFSDirectory.java (revision 1032918) +++ src/java/org/apache/lucene/store/SimpleFSDirectory.java (working copy) @@ -53,7 +53,11 @@ @Override public IndexOutput createOutput(String name) throws IOException { initOutput(name); - return new SimpleFSIndexOutput(new File(directory, name)); + File fullPath = new File(directory, name); + if (!name.equals("segments.gen") && fullPath.exists()) { + throw new RuntimeException("path " + fullPath + " already exists"); + } + return new SimpleFSIndexOutput(fullPath); } /** Creates an IndexInput for the file with the given name. */