about
12/09/2022
CsConcurrentFileAccess Repo
CsConcurrentFileAccess Repository
Supports multiple concurrent file readers and writers
Quick Status
- Add more demonstrations
1.0 Concept
2.0 Design
-
FileReader with methods:
- bool Open(string filename)
- void Close()
- int ReadFile(string filename) - uses Open and Close
- byte[] LastFileRead() - returns all bytes in filename
- int NumAttempts - number of attempts to Open
- int NumFailures - number of failures to Open
- int SleepMilliSecs - time to wait in milliseconds between attempts to Open
-
FileWriter with methods:
- bool Open(string filename)
- void Close()
- int CopyFile(string readPath, string writePath)
- int NumAttempts - number of attempts to Open
- int NumFailures - number of failures to Open
- int SleepMilliSecs - time to wait in milliseconds between attempts to Open
3.0 Build
- The System.IO.File class Open method supports FileShare.Read to allow multiple concurrent readers access to a shared file. That was used in this library to minimize exception handling for read operations.
- At this time, the library does not query the exception to see if continuing is feasible. For example, if the error is file access denial, no amount of retrying will succeed. Eventually the library will incorporate this query test.