Changeset d74c90b in tol


Ignore:
Timestamp:
May 28, 2010, 11:44:33 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
bcf71ac
Parents:
3bb2203
Message:

Fixes #912

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2198 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/OIS/oisstream_zip.cpp

    r3bb2203 rd74c90b  
    186186    header->SetTime(time);
    187187    sh_.zip_.FlushBuffers();
     188    sh_.zip_.OverwriteLocalHeader(index_);
     189    sh_.zip_.RemoveCentralDirectoryFromArchive();
     190    sh_.zip_.CommitChanges();
    188191  }
    189192  catch(CZipException ex)
    … …  
    213216  return(size);
    214217}
    215 
    216218
    217219//--------------------------------------------------------------------
    … …  
    231233      //assert(index_>=0);
    232234    }
     235    sh_.zip_.CommitChanges();
    233236                sh_.zip_.FlushBuffers();
    234237        }
    … …  
    422425  openMode_ = openMode;
    423426  BText action = I2("'INVALID ACTION'", "'ACCIN INVLIDA'");
     427  if(write)
     428  {
     429    BDir path = connection;
     430    if(path.Exist())
     431    {
     432      if(path.IsDir())
     433      {
     434        BText msg = I2("Cannot ","No se puede ")+action+" ZIP "+
     435          connection_+" due it is an existant directory";
     436        if(errorWarning) { Error(msg); }
     437        else             { Warning(msg); }
     438        return(false);
     439      }
     440      else
     441      {
     442        remove(connection);
     443      }
     444    }
     445  }
    424446  try
    425447  {
    … …  
    498520  try
    499521  {
     522    if(openMode_==BSHOM_WRITE)
     523    {
     524      BArray<BText> arr;
     525      arr.AllocBuffer(1);
     526      arr[0] = name;
     527      RemoveFiles(arr);
     528    }
    500529    fs = new BZipStream(*this);
    501530    if(!fs->Open(title,name,openMode_,index))
    … …  
    548577    //Std(BText("TRACE BZipStreamHandler::RemoveFiles() 3.")+n+".1\n");
    549578      files_.Add(str);
     579      k++;
    550580    //Std(BText("TRACE BZipStreamHandler::RemoveFiles() 3.")+n+".1\n");
    551581    }
Note: See TracChangeset for help on using the changeset viewer.