@@ -584,7 +584,8 @@ internal static void ValidatePath(string path)
584
584
}
585
585
586
586
static ReadWriteHelper < string > ? _instance ;
587
- private static ReadWriteHelper < string > Instance => LazyInitializer . EnsureInitialized ( ref _instance , ( ) => new ReadWriteHelper < string > ( ) ) ! ;
587
+ private static ReadWriteHelper < string > Instance
588
+ => LazyInitializer . EnsureInitialized ( ref _instance , ( ) => new ReadWriteHelper < string > ( ) ) ! ;
588
589
589
590
/// <summary>
590
591
/// Manages registering a ReaderWriterLockSlim an synchronizing the provided query write access.
@@ -630,7 +631,8 @@ public static void WriteTo(string path, Action<FileStream> closure,
630
631
int retries = DEFAULT_RETRIES ,
631
632
int millisecondsRetryDelay = DEFAULT_RETRYDELAY ,
632
633
LockTimeout timeout = default ,
633
- bool throwsOnTimeout = false ) => WriteToInternal ( path , closure , retries , millisecondsRetryDelay , timeout , throwsOnTimeout ) ;
634
+ bool throwsOnTimeout = false )
635
+ => WriteToInternal ( path , closure , retries , millisecondsRetryDelay , timeout , throwsOnTimeout ) ;
634
636
635
637
/// <summary>
636
638
/// Manages file stream read access and retries.
@@ -639,7 +641,8 @@ public static void AppendTo(string path, Action<FileStream> closure,
639
641
int retries = DEFAULT_RETRIES ,
640
642
int millisecondsRetryDelay = DEFAULT_RETRYDELAY ,
641
643
LockTimeout timeout = default ,
642
- bool throwsOnTimeout = false ) => WriteToInternal ( path , closure , retries , millisecondsRetryDelay , timeout , throwsOnTimeout , FileMode . Append ) ;
644
+ bool throwsOnTimeout = false )
645
+ => WriteToInternal ( path , closure , retries , millisecondsRetryDelay , timeout , throwsOnTimeout , FileMode . Append ) ;
643
646
644
647
/// <summary>
645
648
/// Manages file stream read access and retries.
@@ -796,11 +799,12 @@ public static T ReadFrom<T>(string path, Func<FileStream, T> closure,
796
799
797
800
public static string ReadToString ( string path , int retries = DEFAULT_RETRIES ,
798
801
int millisecondsRetryDelay = DEFAULT_RETRYDELAY ,
799
- LockTimeout timeout = default ) => ReadFrom ( path , ( fs ) =>
800
- {
801
- using var reader = new StreamReader ( fs ) ;
802
- return reader . ReadToEnd ( ) ;
803
- } , retries , millisecondsRetryDelay , timeout ) ;
802
+ LockTimeout timeout = default )
803
+ => ReadFrom ( path , ( fs ) =>
804
+ {
805
+ using var reader = new StreamReader ( fs ) ;
806
+ return reader . ReadToEnd ( ) ;
807
+ } , retries , millisecondsRetryDelay , timeout ) ;
804
808
805
809
public static class Unsafe
806
810
{
@@ -887,7 +891,8 @@ public static Task<FileStream> GetFileStreamForReadAsync(
887
891
public static FileStream GetFileStreamForRead ( string path ,
888
892
int retries = DEFAULT_RETRIES ,
889
893
int millisecondsRetryDelay = DEFAULT_RETRYDELAY ,
890
- LockTimeout timeout = default ) => ReadFrom ( path , ( ) => Unsafe . GetFileStreamForRead ( path , retries , millisecondsRetryDelay ) , timeout ) ;
894
+ LockTimeout timeout = default )
895
+ => ReadFrom ( path , ( ) => Unsafe . GetFileStreamForRead ( path , retries , millisecondsRetryDelay ) , timeout ) ;
891
896
892
897
/// <summary>
893
898
/// Uses registered read access conditions to determine if a file exists.
0 commit comments