The most simple way would be to utilize the PathAccessAuthorization
event to detect opening of a file for writing:
var server = new FileServer();
...
server.PathAccessAuthorization += (sender, args) =>
{
if (args.Action == FileServerAction.OpenFile && args.RequestedOperations.HasFlag(FileSystemOperation.Write))
{
Console.WriteLine("Opening {0} for writing.", args.FullPath);
}
};
An alternative would be to use a customized file system provider, but that seems to complex if all you need is to detect that a file has been opened for writing.