Skip to content

Conversation

Copy link

Copilot AI commented Jan 4, 2026

The CompressWrite method had two bugs causing "File not found" errors: incorrect logging showed the wrong filepath for disk/memory traces, and path resolution inconsistency between file operations could cause deletion failures.

Changes

  • Fixed trace-specific filepath logging: Introduced new_fp variable to track and log the correct new filepath (fs_filepath, ds_filepath, or mr_filepath) based on trace type
  • Removed redundant path resolution: Eliminated Path.GetFullPath() call before file deletion—now uses the same path for open, compress, and delete operations

Before:

Console.WriteLine($"Writing to new file: {fs_filepath}");  // Always logs fs_filepath
// ...
string full_path_old = Path.GetFullPath(old_fp);
if (File.Exists(full_path_old))
    File.Delete(full_path_old);

After:

Console.WriteLine($"Writing to new file: {new_fp}");  // Logs correct filepath per type
// ...
if (File.Exists(old_fp))
    File.Delete(old_fp);

Applied to both IOTracer and IOTracesCORE projects.

Original prompt

i got error saying "could not find file" for fs. where does that happen


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix file not found error in file system handling Fix filepath logging and deletion path resolution in CompressWrite Jan 4, 2026
Copilot AI requested a review from raflyhangga January 4, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants