#include "lcio.h"
#include "IO/LCWriter.h"
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for addRandomAccess.cc:
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
Variables | |
static std::vector< std::string > | FILEN |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Simple program that opens existing LCIO files and appends the records needed for direct access - if they don't exist.
Definition at line 19 of file addRandomAccess.cc.
00019 { 00020 00021 00022 // create sio writer 00023 LCWriter* lcWrt = LCFactory::getInstance()->createLCWriter() ; 00024 00025 // read file names from command line (only argument) 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 }
std::vector<std::string> FILEN [static] |