00001 #include "lcio.h"
00002
00003 #include "IO/LCWriter.h"
00004
00005
00006 #include <iostream>
00007 #include <sstream>
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010
00011 using namespace lcio ;
00012
00013 static std::vector<std::string> FILEN ;
00014
00015
00016
00017
00018
00019 int main(int argc, char** argv ){
00020
00021
00022
00023 LCWriter* lcWrt = LCFactory::getInstance()->createLCWriter() ;
00024
00025
00026 if( argc < 2) {
00027 std::cout << " usage: addRandomAccess <input-file1> [[input-file2],...]" << std::endl ;
00028 exit(1) ;
00029 }
00030 for(int i=1 ; i < argc ; i++){
00031 FILEN.push_back( argv[i] ) ;
00032 }
00033
00034 int nFiles = argc-1 ;
00035
00036 for( int i=0 ; i <nFiles ; ++i ) {
00037
00038 try{
00039
00040 lcWrt->open( FILEN[i] , LCIO::WRITE_APPEND ) ;
00041
00042 lcWrt->close() ;
00043
00044 }catch(IOException& e){
00045
00046 std::cout << " io error in file " << FILEN[i] << " : " << e.what() << std::endl ;
00047 }
00048 }
00049
00050 return 0 ;
00051 }
00052