Skip to content

use NtSetInformationFile if os.Rename fails#220

Open
karman-docker wants to merge 1 commit into
moby:mainfrom
karman-docker:add_retry_for_rename
Open

use NtSetInformationFile if os.Rename fails#220
karman-docker wants to merge 1 commit into
moby:mainfrom
karman-docker:add_retry_for_rename

Conversation

@karman-docker
Copy link
Copy Markdown

This PR adds atomicwriterRenameAt which uses NtSetInformationFile to rename a file on Windows.

Signed-off-by: Manju Karikatti <manju.karikatti@docker.com>

import "os"

func atomicwriterRenameAt(oldpath, newpath string) error {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: stuttering

Also, why is it called rename At? Usually 'At' implies there's an dirfd provided, which is not the case.

@kolyshkin
Copy link
Copy Markdown
Collaborator

This obviously needs some windows-specific tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants