A library for fast file access on a Windows system using P/Invoke for Win32 API calls. Quickly find files in directories containing hundreds of thousands of files, or check if a file or directory exists on a network share in seconds.
This library is currently under development. The Api may change in future releases. If you have any suggestions or feature requests, please open an issue on the GitHub repository.
- Fast file and directory existence checks
- Fast file searching in directories with a large number of files
// Check access rights for multiple file access requests
var accessChecker = new AccessChecker();
var fileAccessRequest1 = new FileAccessRequest("C:\\Windows\\System32\\cmd.exe", Models.Enums.FileAccessType.ReadData);
var fileAccessRequest2 = new FileAccessRequest("C:\\Windows\\System32\\cmd.exe", Models.Enums.FileAccessType.WriteData);
var results = accessChecker.CheckAccessRights([fileAccessRequest1, fileAccessRequest2]);
foreach (var result in results.Cast<FileAccessRequest>())
{
Console.WriteLine($"Path: {result.Path}, AccessType: {result.AccessType}, Status: {result.Status}");
}
// Search for the newest file matching the pattern "c?d.e*" in the "C:\Windows\System32" directory
var fileSearcher = new FileSearcher();
var searchResults = fileSearcher.FindNewestFile("C:\\Windows\\System32", "c?d.e*");
Console.WriteLine($"Newest file: {searchResults}");