@@ -104,6 +104,8 @@ public override IndexInput OpenInput(string name, IOContext context)
104104 EnsureOpen ( ) ;
105105 EnsureCanRead ( name ) ; // LUCENENET-specific: backported call site from Lucene 6.0.0
106106 var path = Path . Combine ( Directory . FullName , name ) ; // LUCENENET specific: changed to use string file name instead of allocating a FileInfo (#832)
107+ // LUCENENET NOTE: FileShare Read+Write+Delete is correct and matches Java Lucene.
108+ // In Java, FileChannel defaults to this behavior, and Lucene does not override it.
107109 var fc = new FileStream ( path , FileMode . Open , FileAccess . Read , FileShare . ReadWrite | FileShare . Delete ) ;
108110 return new NIOFSIndexInput ( "NIOFSIndexInput(path=\" " + path + "\" )" , fc , context ) ;
109111 }
@@ -113,6 +115,8 @@ public override IndexInputSlicer CreateSlicer(string name, IOContext context)
113115 EnsureOpen ( ) ;
114116 EnsureCanRead ( name ) ; // LUCENENET-specific: this method is not in Lucene 6.0.0 but added to match OpenInput above
115117 var path = Path . Combine ( Directory . FullName , name ) ; // LUCENENET specific: changed to use string file name instead of allocating a FileInfo (#832)
118+ // LUCENENET NOTE: FileShare Read+Write+Delete is correct and matches Java Lucene.
119+ // In Java, FileChannel defaults to this behavior, and Lucene does not override it.
116120 var fc = new FileStream ( path , FileMode . Open , FileAccess . Read , FileShare . ReadWrite | FileShare . Delete ) ;
117121 return new IndexInputSlicerAnonymousClass ( context , path , fc ) ;
118122 }
0 commit comments