Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1016 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 1016 Bytes

FileMonitor

Monitoring file changes in a directory and its subdirectories.

Supported frameworks >= netstandard2.1


Usage

// ... other services

services.AddFileMonitor(options =>
{
    // REQUIRED: The root directory of the files to be monitored.
    options.ContentRoot = Directory.GetCurrentDirectory(); // Or context.HostingEnvironment.ContentRootPath;
    
    // REQUIRED: The relative path of the directory to be monitored.    
    options.FolderPath = "/files";
    
    // REQUIRED: The file extensions to be monitored.
    options.FileExtensions = new[] { ".txt" };
    
    // REQUIRED: The output file name to store the file changes and their MD5 checksums.
    options.OutputFileName = "output.txt";
    
    // OPTIONAL: The sub directories to be excluded.
    options.ExcludedPaths = new[] { "/files/excluded" };
});

... and, TADAAA!!! The output.txt file will be created in the ContentRoot directory, and it will contain the file changes and their MD5 checksums.