Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static Queue<KeyValuePair<string, Queue<string>>> folderFilePairs =
- new Queue<KeyValuePair<string, Queue<string>>>();
- static string rootTmpFolder = string.Empty;
- private static void Initialize()
- {
- using var watcher = new FileSystemWatcher(rootTmpFolder);
- watcher.NotifyFilter = NotifyFilters.Attributes
- | NotifyFilters.CreationTime
- | NotifyFilters.DirectoryName
- | NotifyFilters.FileName
- | NotifyFilters.LastAccess
- | NotifyFilters.LastWrite
- | NotifyFilters.Security
- | NotifyFilters.Size;
- watcher.Changed += OnChanged;
- watcher.Filter = "";
- watcher.IncludeSubdirectories = true;
- watcher.EnableRaisingEvents = true;
- }
- private static void OnChanged(object sender, FileSystemEventArgs e)
- {
- }
- private static void Some()
- {
- var tmpDirectory = Directory.GetDirectories(rootTmpFolder);
- foreach (var tmp in tmpDirectory)
- {
- var filesQueue = new Queue<string>();
- var files = Directory.GetFiles(tmp);
- foreach (var file in files)
- {
- filesQueue.Enqueue(Path.GetFileNameWithoutExtension(file));
- }
- var keyValuePair = new KeyValuePair<string, Queue<string>>(Path.GetDirectoryName(tmp), filesQueue);
- folderFilePairs.Enqueue(keyValuePair);
- }
- }
- private static void OnUploaded(string oldFilePath)
- {
- var directory = Path.GetDirectoryName(oldFilePath);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement