Skip to content

Reject CLI output paths that collide with inputs or another output #79

Open

Description

@mahach666

Reproduced on main

With a small OBJ containing one triangle, ioviewer one.obj -o review.html --json ./review.html exits 0, reports both exports, and leaves a file containing viewer JSON instead of HTML. With a disposable copy of the same OBJ, ioviewer one-copy.obj -o one-copy.obj exits 0 and replaces the source with HTML.

Program.cs checks the files exist, then writes the primary output and --json independently. Atomic exporter writes protect against a failed write (see #9), not against this successful replacement of the wrong file.

Expected

Reject collisions between either output and any input (<input>, --add or --bcf), and between both outputs, before writing anything. Cover relative/absolute spellings and supported link aliases; assert non-zero exit and byte-for-byte preservation of an existing source or destination. Keep normal replacement of a distinct output working.

Activity

  1. added
    bug
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions