lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From petite_abeille <petite_abei...@mac.com>
Subject Re: FSDirectory patch for file renaming
Date Tue, 18 Feb 2003 22:12:41 GMT

On Tuesday, Feb 18, 2003, at 22:59 Europe/Zurich, Matt Tucker wrote:

> I believe that's the current logic used by FSDirectory, and it still
> breaks.

I see... deleting an non-existent file before a rename usually does the 
trick under the different Windows flavors...

If the destination file exists in the first place... have you tried to 
simply recreate the File object after the first delete if the file did 
exists? Something like:

// aDestinationFile exists in this case... get ride of it...

aDestinationFile.delete();

// FIXME: Hack to flush something, somewhere in the vm... sigh...

aDestinationFile = null;
aDestinationFile = new File( aPath );
aDestinationFile.delete();

// Finally do the rename...

aSourceFile.renameTo( aDestinationFile );

PA.





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


Mime
View raw message