directory icon indicating copy to clipboard operation
directory copied to clipboard

Enable `MOVEFILE_COPY_ALLOWED` by default for `renameFileInternal` for Windows

Open jasagredo opened this issue 5 months ago • 1 comments

Currently only MOVEFILE_REPLACE_EXISTING is enabled but I don't think there would be a downside to enable the mentioned flag. The documentation for that one says:

If the file is to be moved to a different volume, the function simulates the move by using the CopyFile and DeleteFile functions.

My motivation here is: I'm trying to make Cabal use the global temp directory for creating temp files instead of the final destination directory (as GetTempFileName doesn't support long paths, which is one of the few remaining uses of functions that can't use long paths in cabal) but the temp dir in GHA (and potentially in the user's system could be) is in C: and the working dir is in D:, so renaming paths fails because the mentioned flag is not set.

Similarly, if I override the temp dir to something in D: (like ${{ runner.temp }}) cabal can't copy files to the store which is then in C:.

jasagredo avatar Sep 18 '24 22:09 jasagredo