6 #define LCSIO_RANDOMACCESS_SIZE 112
14 using namespace lcio ;
22 int main(
int argc,
char** argv ){
26 LCWriter* lcWrt = LCFactory::getInstance()->createLCWriter() ;
30 std::cout <<
" usage: addRandomAccess <input-file1> [[input-file2],...]" <<
std::endl ;
38 if( firstArg ==
"-f" ){
40 std::cout <<
" ====== called with -f (force) : will create a TOC for direct access in any case ! " <<
std::endl ;
44 for(
int i=firstFile ; i < argc ; i++){
48 int nFiles = argc - firstFile ;
50 for(
int i=0 ; i <nFiles ; ++i ) {
59 FILE* f = fopen(
FILEN[i].c_str() ,
"r+") ;
67 int status = fread( &bla[0] ,
sizeof(
char) , 16 , f ) ;
69 if( !strcmp( bla.
c_str() ,
"LCIORandomAccess") || status != 16 ){
72 status = fseek( f , -(16) , SEEK_CUR ) ;
74 bla =
"LCIORandomIGNORE" ;
76 status = fwrite( &bla[0] , 1 , 16 , f ) ;
85 lcWrt->open(
FILEN[i] , LCIO::WRITE_APPEND ) ;
89 }
catch(IOException& e){
#define LCSIO_RANDOMACCESS_SIZE
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
static std::vector< std::string > FILEN