Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rename directories on Windows does not need syscall.Fsync() on rename. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

nelsonjr
Copy link

On Windows the os.Rename does not require a subsequent call to syscall.Fsync(). This change avoid ERROR_ACCESS_DENIED as the folder is already opened by the process that extracted the installation.

@nelsonjr nelsonjr merged commit 345a8df into master Jun 24, 2023
@keegancsmith keegancsmith deleted the nelsona/windows-no-fsync branch June 26, 2023 17:32
Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

if we are only doing renames on directories then indeed this should be safe. Otherwise if we are trying to do some sort of atomic file writing maybe it is worth using this package which seems to have support for windows. https://github.com/natefinch/atomic

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.

3 participants