Skip to content

os.Stat, os.ReadDir should not fail when a file does not existΒ #15019

Closed

Description

@bep

I'm fixing some related issue in this package, and stumbled upon this. A side comment: We should probably consider if these file funcs are worth keeping; there are known issues and most if not all usage can be replaced with the resources API.

Activity

  1. self-assigned this
    on Jun 9, 2026
  2. changed the title [-]os.Stat should not fail when a file does not exist[/-] [+]os.Stat, os.ReadDir should not fail when a file does not exist[/+] on Jun 9, 2026
  3. added 2 commits that reference this issue on Jun 9, 2026
    b7553c5
    9334d4e
  4. added a commit that references this issue on Jun 10, 2026
    cf9c8f9
  5. thkukuk commented on Jun 28, 2026

    @thkukuk

    I don't understand this Bug description, why do symlinks, which points to a file (I don't speak about stale symlinks), be a problem?
    The result is really bad. To avoid to duplicate big data, I use symlinks in the "static" directory. This doesn't work any longer.
    Since hugo also does not preserve hardlinks, this is becoming a real disk space issue.

  6. nnsite commented on Jul 24, 2026

    @nnsite

    I agree on this, I've been using symlinks for the same purpose for years now.
    Hardlinks still work, but data gets duplicated when I archive and unzipped projects.
    The fix is more damaging than the issues, which I never encountered.
    And by the way, symlinks also fail in assets. There is no alternative. Symlinks are much simpler often than modules.
    I hope for a reversion.

  7. github-actions commented on Sep 2, 2026

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  8. locked as resolved and limited conversation to collaborators on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions