Closed hsenag closed 5 months ago
I can confirm. The relevant code is here:
Fix is here: https://github.com/haskell/directory/pull/178
However, I suggest @Rufflewind that we consider to use the package file-io for this in the future so that we can consolidate such low-level functionality. Having complicated Win32 code spread around different packages is problematic.
The openExistingFile function from that package does not suffer from this issue.
@bgamari do you have visibility which GHC versions ship with this bug?
Thanks for the quick fix/release!
This affects directory 1.3.8.0 through 1.3.8.4, which maps to GHC 9.6.1 through 9.10.1 according to https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
I have opened GHC#24843 to ensure that this bump is performed in future minor releases.
This affects directory 1.3.8.0 through 1.3.8.4,
Would be good to add this info in the release notes.
on Windows,
copyFile nonexistent shouldnotexist
succeeds and leaves 0-byte files for both
nonexistent
andshouldnotexist
.I would expect it to throw an exception and not create either source or destination file, which is what happens on Linux and MacOS.
The behaviour seems to have started in directory-1.3.8.0 and I bisected it to 78b3e59. I'm fairly sure it's
directory
because I did things like holding Win32 and trying with a range of GHCs. With default versions we only noticed it starting with GHC 9.6, but I get the same behaviour with GHC 9.4.8+Win32 2.13.3.0+directory 1.3.8.0 (for example).I used this test program to track down where the problem started:
ref: https://bugs.darcs.net/issue2721