[Issue 23910] New: std.file.remove acts differently on Windows and Linux

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 10 07:00:38 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23910

          Issue ID: 23910
           Summary: std.file.remove acts differently on Windows and Linux
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: post at larskyllingstad.no

On Windows, std.file.remove calls DeleteFileW, which can only delete regular
files.  On POSIX, it calls remove(3), which can remove both files and (empty)
directories.

Depending on how we *want* it to work, it should conditionally call DeleteFileW
or RemoveDirectoryW on Windows, or it should call unlink(2) on POSIX. The
former solution is far less of a breaking change, but the breakage is more
subtle and silent.

--


More information about the Digitalmars-d-bugs mailing list