Re: [PATCH 1/2] Work around leftover temporary save file.
- From
Alexey Borzenkov <snaury@gmail.com>
- Date
- Sep 15, 2009, 14:14 UTC
- Message-ID
- <e2480c70909150714n3b7d6018rcb5bcb42d1d78218@mail.gmail.com>
- In-Reply-To
- <81b0412b0909150601j74d40181pc2308f4f63b4817e@mail.gmail.com>
On Tue, Sep 15, 2009 at 5:01 PM, Alex Riesen <raa.lkml@gmail.com> wrote:
Show 27 quoted lines
> On Tue, Sep 15, 2009 at 11:26, Pat Thoyts
> <patthoyts@users.sourceforge.net> wrote:
>>
>> If a file exists and is hidden on Windows the Tcl open command will
>> fail as the attributes provided in the CREAT call fail to match those
>> of the existing file. Forcing removal of the temporary file before we
>> begin solves any problems caused by previous failures to save the
>> application settings. An alternative would be to remove the hidden
>> attribute before calling 'open'.
>>
>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
>> ---
>> gitk | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/gitk b/gitk
>> index 1306178..a0214b7 100755
>> --- a/gitk
>> +++ b/gitk
>> @@ -2526,6 +2526,7 @@ proc savestuff {w} {
>> if {$stuffsaved} return
>> if {![winfo viewable .]} return
>> catch {
>> + if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
>
> maybe another gitk instance is writing it at exactly same moment
> in time? Writing is known to take a few moments. Especially on Windows.Then deleting would fail, because on Windows opened files cannot be deleted (unless they are opened in a special way that permits it).