Skip to content

False 'pre-existing file' warning on case-insensitive filesystems (macOS) #2282

Description

@Rhyoss

On macOS (case-insensitive APFS), graphify export obsidian reports notes it created as pre-existing user files:
Neither file exists on disk. The reported names never reach the filesystem.

Cause: the graph contains labels that differ only by case. In this repo, 14 such pairs: AGORA/agora, Deploy/deploy, LEAD/Lead, GET()/get(), Row/row, STATUS/Status, and 8 more. On a case-insensitive filesystem AGORA.md and agora.md are the same path. The export writes one, then the "did I create this file?" check for the other compares by exact name, fails to match the _1-disambiguated sibling, and classifies its own output as a user note.

Impact: cosmetic here. I verified all 28 labels across the 14 colliding pairs do get a note via the _1 suffix, so nothing was lost. But the check is unsound: a real user note whose name collides by case with a node label could be misclassified in the other direction.

Suggested fix: normalise with os.path.normcase (or compare Path.resolve()) when deciding whether an output path was created by graphify, and detect case-insensitivity of the target filesystem rather than assuming exact-name equality.

Environment: macOS, APFS (case-insensitive), graphifyy installed via uv tool, corpus ~930 files / 5359 nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions