I've been given an IFileProvider and I'm trying to use it monitor a directory for file updates via the Watch() method.
private void WatchDirectory(IFileProvider fileProvider, string directoryPath = @"*/MyDir/*")
{
var token = fileProvider.Watch(directoryPath);
token.RegisterChangeCallback(i => Console.WriteLine($"File updated: { [What goes here?] }"), null);
}
Ideally I'd receive the IFileInfo and a flag saying whether it was created, renamed, modified, or deleted; but even just the filename would be good.
The problem is I can't find any examples or documentation for accomplishing anything more than a count (which doesn't seem useful to me). Does anyone have any suggestions on how to do this?