1 Commits

Author SHA1 Message Date
a46635a264 log-information (Day-Helper-2025-06-28) 2025-06-28 19:29:12 -07:00
3 changed files with 55 additions and 0 deletions

6
.vscode/launch.json vendored
View File

@ -11,6 +11,12 @@
"preLaunchTask": "build", "preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll", "program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
"args": [ "args": [
"s",
"X",
"D:/0-ISO-A",
"Day-Helper-2025-06-28",
"*.iso",
"F",
"s", "s",
"X", "X",
"D:/5-Other-Small", "D:/5-Other-Small",

View File

@ -0,0 +1,47 @@
using DiscUtils;
using DiscUtils.Iso9660;
using Microsoft.Extensions.Logging;
namespace File_Folder_Helper.ADO2025.PI6;
internal static partial class Helper20250628 {
private record File(long LastWriteTicks,
long Length,
string RelativePath);
internal static void LogInformation(ILogger<Worker> logger, List<string> args) {
logger.LogInformation(args[0]);
logger.LogInformation(args[1]);
logger.LogInformation(args[2]);
string searchPattern = args[2];
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
string[] searchPatternFiles = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
LogInformation(logger, searchPatternFiles, args[3]);
}
private static void LogInformation(ILogger<Worker> logger, string[] searchPatternFiles, string letter) {
File file;
string[] files;
DiscFileInfo discFileInfo;
foreach (string searchPatternFile in searchPatternFiles) {
if (string.IsNullOrEmpty(searchPatternFile)) {
using FileStream fileStream = System.IO.File.OpenRead(searchPatternFile);
CDReader reader = new(fileStream, true);
files = reader.GetFiles("", "*");
foreach (string f in files) {
discFileInfo = reader.GetFileInfo(f);
file = new(LastWriteTicks: discFileInfo.LastWriteTime.Ticks, Length: discFileInfo.Length, RelativePath: f);
}
}
logger.LogInformation("mountvol $driveLetter $volInfo.UniqueId");
logger.LogInformation("$volInfo = $diskImg | Get-Volume");
logger.LogInformation("$diskImg = Mount-DiskImage -ImagePath $isoImg -NoDriveLetter");
logger.LogInformation($"$driveLetter = \"{letter}:\"");
logger.LogInformation($"$isoImg = \"{searchPatternFile}\"");
logger.LogInformation(string.Empty);
}
}
}

View File

@ -171,6 +171,8 @@ internal static class HelperDay
ADO2025.PI6.Helper20250602.EquipmentAutomationFrameworkCellInstanceStateImageVerbIf(logger, args); ADO2025.PI6.Helper20250602.EquipmentAutomationFrameworkCellInstanceStateImageVerbIf(logger, args);
else if (args[1] == "Day-Helper-2025-06-18") else if (args[1] == "Day-Helper-2025-06-18")
ADO2025.PI6.Helper20250618.MoveAllButXOfEach(logger, args); ADO2025.PI6.Helper20250618.MoveAllButXOfEach(logger, args);
else if (args[1] == "Day-Helper-2025-06-28")
ADO2025.PI6.Helper20250628.LogInformation(logger, args);
else else
throw new Exception(appSettings.Company); throw new Exception(appSettings.Company);
} }