diff --git a/Source/Workspace/Celbridge.Resources/Helpers/ResourceUtils.cs b/Source/Workspace/Celbridge.Resources/Helpers/ResourceUtils.cs index cd050f53..b22c631c 100644 --- a/Source/Workspace/Celbridge.Resources/Helpers/ResourceUtils.cs +++ b/Source/Workspace/Celbridge.Resources/Helpers/ResourceUtils.cs @@ -4,35 +4,6 @@ namespace Celbridge.Resources.Helpers; public class ResourceUtils { - public static void CopyFolder(string sourceFolder, string destFolder) - { - DirectoryInfo dir = new DirectoryInfo(sourceFolder); - - if (!dir.Exists) - { - throw new DirectoryNotFoundException($"Source directory does not exist or could not be found: {sourceFolder}"); - } - - DirectoryInfo[] dirs = dir.GetDirectories(); - if (!Directory.Exists(destFolder)) - { - Directory.CreateDirectory(destFolder); - } - - FileInfo[] files = dir.GetFiles(); - foreach (FileInfo file in files) - { - string tempPath = Path.Combine(destFolder, file.Name); - file.CopyTo(tempPath); - } - - foreach (DirectoryInfo subdir in dirs) - { - string tempPath = Path.Combine(destFolder, subdir.Name); - CopyFolder(subdir.FullName, tempPath); - } - } - public static async Task OpenApplication(string path) { await Task.CompletedTask; diff --git a/Source/Workspace/Celbridge.Resources/Helpers/SidecarHelper.cs b/Source/Workspace/Celbridge.Resources/Helpers/SidecarHelper.cs index 4864bcb9..1b790b07 100644 --- a/Source/Workspace/Celbridge.Resources/Helpers/SidecarHelper.cs +++ b/Source/Workspace/Celbridge.Resources/Helpers/SidecarHelper.cs @@ -346,6 +346,11 @@ private static string StripTrailingTerminator(string content) /// public static CelFileStatus Inspect(string absolutePath, ILogger logger) { + // Direct read rather than via IFileStorage: Inspect runs synchronously + // inside ResourceClassifier during UpdateResourceRegistry, the absolute + // path has already been resolved through the root handler registry, and + // a transient read failure is benign (the file gets classified Broken + // and the next registry pass reclassifies it). string text; try { diff --git a/Source/Workspace/Celbridge.Resources/Services/FileStorage.cs b/Source/Workspace/Celbridge.Resources/Services/FileStorage.cs index 637ad28a..18d27e91 100644 --- a/Source/Workspace/Celbridge.Resources/Services/FileStorage.cs +++ b/Source/Workspace/Celbridge.Resources/Services/FileStorage.cs @@ -661,8 +661,8 @@ private static bool IsRootWritable(IRootHandlerRegistry rootHandlerRegistry, Res || handler.Capabilities.IsWritable; } - // Recursive folder copy. Mirrors ResourceUtils.CopyFolder but stays internal - // to the FS layer so the chokepoint owns the destination structure. + // Recursive folder copy used by the chokepoint's CopyAsync path. Stays + // internal to the FS layer so the chokepoint owns the destination structure. private static void CopyFolderRecursive(string sourceFolder, string destFolder) { Directory.CreateDirectory(destFolder);