Doug Cutting wrote:
I've attached a patch.  Does this fix things for you?

Oops.  That had a bug.

Here's a revised patch.  It now passes all unit tests.

Doug
Index: src/java/org/apache/lucene/store/FSDirectory.java
===================================================================
--- src/java/org/apache/lucene/store/FSDirectory.java	(revision 178648)
+++ src/java/org/apache/lucene/store/FSDirectory.java	(working copy)
@@ -306,6 +306,10 @@
   /** Creates a new, empty file in the directory with the given name.
       Returns a stream writing this file. */
   public IndexOutput createOutput(String name) throws IOException {
+    File file = new File(directory, name);
+    if (file.exists() && !file.delete())          // delete existing, if any
+      throw new IOException("Cannot delete " + name);
+
     return new FSIndexOutput(new File(directory, name));
   }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to