in reply to Re: Re: Frustration with changing lock type
in thread Frustration with changing lock type
Hmm, I think you still have a race in the OnDestroy: if I understand flock() correctly, the lock is released as soon as you close the filehandle, so the unlink() happens after the lock has been released.
If I remember right, Win32 doesn't let you unlink a file while anyone still has a handle open on it, so maybe it would be better instead to truncate the file to zero bytes on completion, which is something you can do with an open filehandle.
Hugo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Frustration with changing lock type
by demerphq (Chancellor) on Apr 14, 2004 at 12:53 UTC | |
by hv (Prior) on Apr 14, 2004 at 13:02 UTC | |
|
Re^4: Frustration with changing lock type (share delete access)
by tye (Sage) on Apr 14, 2004 at 15:11 UTC |