Skip to content

mingw: Fix unlink for open files #1665

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

Closed
wants to merge 1 commit into from

Conversation

orgads
Copy link

@orgads orgads commented May 8, 2018

Fixes #1653

@orgads
Copy link
Author

orgads commented May 8, 2018

This solves the issue for files that are open for read (which is the most annoying issue). Files that are open for write will remain with their contents after write.

I still need to polish this. Wait a bit.

Fixes git#1653

Signed-off-by: Orgad Shaneh <[email protected]>
@orgads
Copy link
Author

orgads commented May 8, 2018

Now it should also work correctly for files that are open for write. It cannot overwrite them, but will let the user choose whether to retry or fail.

@ghost
Copy link

ghost commented May 8, 2018

The following comment from the Kernel Transaction Manager docs makes me wonder if this is the right approach:

Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using Transactional NTFS.

There is no point in doing a transaction for a single operation, right? It's just a different API and it happens to work better in this use case.

@orgads
Copy link
Author

orgads commented May 8, 2018

I've noticed this doc, but as you said, it happens to work, unlike unlink (which itself works, but fails on file recreation later).

@orgads
Copy link
Author

orgads commented May 9, 2018

Superseded by #1666.

@orgads orgads closed this May 9, 2018
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.

1 participant