Skip to content

System.FilePath.Posix treats filenames with leading .s as extensions #259

@TOTBWF

Description

@TOTBWF

Right now System.FilePath.Posix.splitExtension will treat any leading . in a path as an extension. This leads to some odd behaviour:

import System.FilePath.Posix

splitExtension "myrepo/.git"
-- returns ("myrepo/", ".git")

splitExtension "myrepo/.."
-- returns ("myrepo/.",".")

I'd expect for splitExtension to treat a file whose leading character is a . as a filename. This appears to be consistent across all functions that work on paths (takeBaseName, etc). Changing these would be a pretty big breaking change, but at the very least this should probably be mentioned in the docs.

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