Describe the bug
In the construcotr of DbfTable which takes a path to the table you change the attributes of the file in question to open:
public DbfTable(string path, Encoding encoding = null)
{
if (!File.Exists(path)) throw new FileNotFoundException();
Path = path;
CurrentEncoding = encoding;
// https://stackoverflow.com/questions/23559452/stream-reader-process-cannot-access-file-because-its-in-use-by-another-process
File.SetAttributes(path, FileAttributes.Normal); // <-- Do not do this!
Stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Init();
var memoPath = MemoPath();
if (!string.IsNullOrEmpty(memoPath)) Memo = CreateMemo(memoPath);
}
This for example clears the hidden state of the file. It is generally a bad idea to mess with files you have no control over. If the file can not be opened, because it is used by another process the code should just fail here. The developer using the library is responsible for taking the right actions if that happens.
Describe the bug In the construcotr of DbfTable which takes a path to the table you change the attributes of the file in question to open:
This for example clears the hidden state of the file. It is generally a bad idea to mess with files you have no control over. If the file can not be opened, because it is used by another process the code should just fail here. The developer using the library is responsible for taking the right actions if that happens.