Bug 23910 – std.file.remove acts differently on Windows and Linux

Status
NEW
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-05-10T07:00:38Z
Last change time
2024-12-01T16:41:22Z
Assigned to
No Owner
Creator
Lars T. Kyllingstad
Moved to GitHub: phobos#10522 →

Comments

Comment #0 by post — 2023-05-10T07:00:38Z
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.
Comment #1 by robert.schadek — 2024-12-01T16:41:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10522 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB