git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C Hamano
Message 3 of 3 in “mingw_rename: do support directory renames”
  1. mingw_rename: do support directory renamesJohannes Schindelin via GitGitGadget, Dec 17, 2024
  2. Junio C HamanoDec 17, 2024
  3. Patrick SteinhardtDec 18, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.