anchor.diff:              SaveSimple(AFileName);
               MsgBox(Format(msgCannotSaveFileWithEnc, [OldEncoding]), MB_OK or MB_ICONWARNING);
             end;
  -        on E: EFileNotFoundException do
  +        on E: EFOpenError do
             begin
  -            MsgBox(msgCannotSaveFile+#10+AFileName, MB_OK or MB_ICONERROR);
  -            exit(false);
  +            SaveViaTempCopy(AFileName);
  +            if IsBadResultFile(AFileName) then
  +              raise;
             end;
           else
             raise;
  
positive.code:     Result:= (not FileExists(fn)) or (FileUtil.FileSize(fn)=0);
    end;
    //
  var
    OldEncoding: string;
    OldAttr: Longint;
    STempFilename: string;
  begin
    Result:= true;
    while true do
  
negative.code:     AppFileAttrRestore(AFileName, OldAttr);
      exit;
    except
      on E: Exception do
      begin
        if MsgBox(E.ClassName+#10+E.Message, MB_RETRYCANCEL or MB_ICONERROR) = IDCANCEL then
          exit(false);
      end;
    end;
  end;
  
  