beagle r4510 - in branches/beagle-lucene2_1/beagled/Lucene.Net: Store upstream-changes



Author: dbera
Date: Thu Feb 21 01:40:59 2008
New Revision: 4510
URL: http://svn.gnome.org/viewvc/beagle?rev=4510&view=rev

Log:
Add patch #2: use correct FileShare during renaming files.


Added:
   branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/02_FSDirectory-rename-fileshare.patch
Modified:
   branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs

Modified: branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/Store/FSDirectory.cs	Thu Feb 21 01:40:59 2008
@@ -494,7 +494,7 @@
 					try
 					{
 						in_Renamed = new System.IO.FileStream(old.FullName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
-						out_Renamed = new System.IO.FileStream(nu.FullName, System.IO.FileMode.Create);
+						out_Renamed = new System.IO.FileStream(nu.FullName, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
 						// see if the buffer needs to be initialized. Initialization is
 						// only done on-demand since many VM's will never run into the renameTo
 						// bug and hence shouldn't waste 1K of mem for no reason.
@@ -849,4 +849,4 @@
 			return file.BaseStream.Length;
 		}
 	}
-}
\ No newline at end of file
+}

Added: branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/02_FSDirectory-rename-fileshare.patch
==============================================================================
--- (empty file)
+++ branches/beagle-lucene2_1/beagled/Lucene.Net/upstream-changes/02_FSDirectory-rename-fileshare.patch	Thu Feb 21 01:40:59 2008
@@ -0,0 +1,24 @@
+From: Jon Trowbridge <trow novell com>
+
+Open the FileStream with FileShare.ReadWrite.
+
+Index: Store/FSDirectory.cs
+===================================================================
+--- Store/FSDirectory.cs	(revision 4506)
++++ Store/FSDirectory.cs	(working copy)
+@@ -494,7 +494,7 @@
+ 					try
+ 					{
+ 						in_Renamed = new System.IO.FileStream(old.FullName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
+-						out_Renamed = new System.IO.FileStream(nu.FullName, System.IO.FileMode.Create);
++						out_Renamed = new System.IO.FileStream(nu.FullName, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
+ 						// see if the buffer needs to be initialized. Initialization is
+ 						// only done on-demand since many VM's will never run into the renameTo
+ 						// bug and hence shouldn't waste 1K of mem for no reason.
+@@ -849,4 +849,4 @@
+ 			return file.BaseStream.Length;
+ 		}
+ 	}
+-}
+\ No newline at end of file
++}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]