public void RootFolder(DirectoryInfo rootDirectory) { _DiskName = rootDirectory.FullName; _ACESet = new ACESet(); _ACLSet = new ACLSet(); var now = DateTime.Now.ToString("u"); string filenames = ""; Console.WriteLine($"{now} : Disk {_DiskName}, Inventory Start."); ScanTime.Start(); int errorCount = EachFolder(rootDirectory, 0, 0); if (driveFileTasks.Count > 0) { // anything hashed? PendAtEndTime.Start(); var taskAndFileArray = driveFileTasks.Where(x => !x.task.IsCompleted).ToArray(); // toarray to stabilise the list HashPendAtEnd = taskAndFileArray.Length; if (HashPendAtEnd > 0) { // anything still left to hash? var taskArray = taskAndFileArray.Select(x => x.task).ToArray(); // get task list to wait on filenames = String.Join(";", taskAndFileArray.Select(x => x.filename).ToArray()); Task.WaitAll(taskArray); // wait for any file scans to finish! } PendAtEndTime.Stop(); } ScanTime.Stop(); SummaryStatistics(rootDirectory.FullName, errorCount, filenames); }
private void HandleFile(string aclfile, string filefile) { { //var aclstring = GZfileIO.ReadGZtoString(aclfile); //var filestring = GZfileIO.ReadGZtoString(filefile); //_ACESet = ACESet.FromJSON(aclfile); //int ix = 0; _ACLSet = ACLSet.FromJSON(aclfile); _ACLSet.ToDB(); directories = CIMDirectoryCollection.FromJSON(filefile); } }