Re: [PATCH] mingw_rename: do support directory renames
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 18, 2024, 06:00 UTC
- Message-ID
- <Z2JlBQ4DNf7tsNxV@pks.im>
- In-Reply-To
- <pull.1839.git.1734439924842.gitgitgadget@gmail.com>
On Tue, Dec 17, 2024 at 12:52:04PM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 13 quoted lines
> diff --git a/compat/mingw.c b/compat/mingw.c
> index c4320769db6..e8f491d03a7 100644
> --- a/compat/mingw.c
> +++ b/compat/mingw.c
> @@ -2273,7 +2273,7 @@ repeat:
>
> old_handle = CreateFileW(wpold, DELETE,
> FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
> - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
> + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
> if (old_handle == INVALID_HANDLE_VALUE) {
> errno = err_win_to_posix(GetLastError());
> return -1;Okay. I saw that FILE_FLAG_BACKUP_SEMANTICS was used in several other users of `CreateFileW()` in this context, but I couldn't find good enough information around what it is actually doing anywhere. The explanation makes sense to me, so thanks for the follow-up fix!
Patrick