private static void Monitor_DeviceConnected(object sender, DeviceDataEventArgs e) { Log.Information("Device connected", e.Device); char letter = DriveHelpers.GetNextAvailableDriveLetter(); VirtualDrive drive = new VirtualDrive(e.Device, Monitor.Socket, letter); Devices.Add(drive); new Thread(new ThreadStart(() => { drive.Mount(letter + ":\\", /*DokanOptions.DebugMode | DokanOptions.StderrOutput | */ DokanOptions.RemovableDrive, new NullLogger()); })).Start(); }
public NtStatus FindFilesWithPattern(string fileName, string searchPattern, out IList <FileInformation> files, IDokanFileInfo info) { files = new List <FileInformation>(); if (Sync != null) { if (Sync.IsOpen) { List <FileStatistics> stats = Sync.GetDirectoryListing(DriveHelpers.ConvertToUnixPath(fileName)).ToList(); foreach (FileStatistics s in stats) { files.Add(DriveHelpers.ConvertToWindowsFile(s)); } } } Log.Information(fileName); return(DokanResult.Success); }