Changeset 632
- Timestamp:
- Apr 14, 2015, 1:23:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal_otb.c
r631 r632 272 272 if(tmpVal!=NULL){ 273 273 if(strncasecmp(tmpVal->value,"application/zip",14)==0){ 274 char tmpName[1024]; 275 symlink(test->value,ReplaceAll(test->value,".zca",".zip").c_str()); 276 sprintf(tmpName,"/vsizip/%s",ReplaceAll(test->value,".zca",".zip").c_str()); 274 char *tmpName=(char*)malloc((strlen(test->value)+9)*sizeof(char)); 275 std::string test0(test->value); 276 if(test0.find(".zca")!=std::string::npos){ 277 symlink(test->value,ReplaceAll(test->value,".zca",".zip").c_str()); 278 sprintf(tmpName,"/vsizip/%s",ReplaceAll(test->value,".zca",".zip").c_str()); 279 }else 280 sprintf(tmpName,"/vsizip/%s",test->value); 277 281 char **files=VSIReadDir(tmpName); 278 282 int nFiles = CSLCount( files ); 279 char tmpSSName[1024];280 sprintf(tmpSSName,"%s/Input_%s_%s",tmpPath->value, s->name,tmpSid->value);283 char *tmpSSName=(char*)malloc((strlen(tmpPath->value)+strlen(paramKey.c_str())+strlen(tmpSid->value)+9)*sizeof(char)); 284 sprintf(tmpSSName,"%s/Input_%s_%s",tmpPath->value,paramKey.c_str(),tmpSid->value); 281 285 mkdir(tmpSSName,0777); 282 286 283 char tmpSName[1024];284 287 for(int kk=0;kk<nFiles;kk++){ 288 char *tmpSName=(char*)malloc((strlen(tmpName)+strlen(files[kk])+2)*sizeof(char)); 285 289 sprintf(tmpSName,"%s/%s",tmpName,files[kk]); 286 290 VSILFILE* fmain=VSIFOpenL(tmpSName, "rb"); … … 293 297 VSIFReadL(content,1,count*sizeof(char),fmain); 294 298 295 char tmpSSSName[1024];299 char *tmpSSSName=(char*)malloc((strlen(tmpSSName)+strlen(files[kk])+2)*sizeof(char)); 296 300 sprintf(tmpSSSName,"%s/%s",tmpSSName,files[kk]); 297 301 … … 306 310 test=getMapFromMaps(inputs,paramKey.c_str(),"cache_file"); 307 311 } 312 free(tmpSSSName); 308 313 } 314 free(tmpSName); 309 315 } 316 free(tmpSSName); 317 free(tmpName); 310 318 } 311 319 }
Note: See TracChangeset
for help on using the changeset viewer.