Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
a46635a264 |
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
@ -11,6 +11,12 @@
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
||||
"args": [
|
||||
"s",
|
||||
"X",
|
||||
"D:/0-ISO-A",
|
||||
"Day-Helper-2025-06-28",
|
||||
"*.iso",
|
||||
"F",
|
||||
"s",
|
||||
"X",
|
||||
"D:/5-Other-Small",
|
||||
|
47
ADO2025/PI6/Helper-2025-06-28.cs
Normal file
47
ADO2025/PI6/Helper-2025-06-28.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -171,6 +171,8 @@ internal static class HelperDay
|
||||
ADO2025.PI6.Helper20250602.EquipmentAutomationFrameworkCellInstanceStateImageVerbIf(logger, args);
|
||||
else if (args[1] == "Day-Helper-2025-06-18")
|
||||
ADO2025.PI6.Helper20250618.MoveAllButXOfEach(logger, args);
|
||||
else if (args[1] == "Day-Helper-2025-06-28")
|
||||
ADO2025.PI6.Helper20250628.LogInformation(logger, args);
|
||||
else
|
||||
throw new Exception(appSettings.Company);
|
||||
}
|
||||
|
Reference in New Issue
Block a user