Skip to content

ctags tagfile export should replace output atomically #2886

Description

@Widthdom

Finding

export ctags writes directly to the requested output path with StreamWriter(..., append: false, ...). A crash, cancellation, or IO failure can leave a partially written tagfile in place.

Evidence

  • src/CodeIndex/Cli/ExportImportCommandRunner.cs:262 creates the output directory.
  • src/CodeIndex/Cli/ExportImportCommandRunner.cs:265 opens the final output path directly.
  • The command then streams all symbol rows to that final path.

Suggested fix

Write to a temporary file in the same directory, flush it, then atomically replace or move it into place. Add tests for failure before replacement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions