Re: [PATCH v2 1/1] bundle: cleanup lock files on error
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 15, 2018, 16:49 UTC
- Message-ID
- <CACsJy8DZkEb6d=PW4bdkipTSkUSG7YUqk4tkG9PXx+bfngFW1A@mail.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1811151354150.41@tvgsbejvaqbjf.bet>
On Thu, Nov 15, 2018 at 1:59 PM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 6 quoted lines
> So yes, we are trying to unlink the `.lock` file, and as far as I can tell that > `unlink()` call comes from the tempfile cleanup asked for by Martin. However, as > we still have a handle open to that file, that call fails. > > I do not think that there is any better way to fix this than to close the file > explicitly.
I may be talking nonsense here but I remember someone mentioned something about deleting a file while it's still open on Windows and after a quick internet search, it may be FILE_SHARE_DELETE. Since _we_ open these files, can we just open them with this to be able to delete them?
-- Duy