Skip to content

long paths not supported on windows for rename, getFileStatus #56

@joeyh

Description

@joeyh

System.PosixCompat.Files.rename will fail if a filename is longer than 285 characters or so, which is a default limit in Windows.

This is because it uses moveFileEx from Win32, and Win32 is a direct mapping to the win32 api. However, the problem could be avoided if the path were converted to "UNC-style" first. That conversion is how ghc is generally supporting long filenames on windows.

One easy fix would be to depend on directory-1.3.9.0 and use renamePath instead of moveFileEx. It so happens that renamePath does do UNC-style conversion, before passing it off to Win32.

(There are probably some other functions that also don't support long filenames.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions