Linear Collider Forum

Home » Software Tools » LCIO » LCWriter error when inputfile and outpufile only differ in "_" changed to "."
LCWriter error when inputfile and outpufile only differ in "_" changed to "." [message #1731] Fri, 24 April 2009 01:09 Go to previous message
Messages: 43
Registered: August 2007
Location: DESY Hamburg

When using a self written program, that changes LCIO run header information, I experienced a strange error:

I read in a file named "cosmic_0091-01_P5_stagg-2_3_5T.001.slcio" and try to write to a file named "cosmic_0091-01_P5_stagg-2_3.5T.001.slcio". So the names only differ in "3_5T" changed to "3.5T".

When running the program I get the following error message:
"lcio::IOException: [SIOWriter::open()] Bad or duplicate stream name: cosmic_009101_P5_stagg2_3_5T_001_slcio".

This happens in the line where I open the output file (the input file is opened without problem and I can read from it earlier during the execution):
LCWriter* fLCWriter = LCFactory::getInstance()->createLCWriter();

When I change the "." in "3.5T" in the output file name to another character or number or use a completely other name it works fine. When I use the above given output file name but a different directory for the output it works fine.
It seems like the open command interprets the "." like in an regular expression (where it stands for any character) when the checking if the file already exists is done.

I did my tests under Scientific Linux 4 with different LCIO versions (v01-08, v01-09 and v01-10).

It is not a big problem, since it is easy to avoid, but I thought this might be interesting for bug fixing ... and save others from spending time and wondering why the writing doesn't work Smile

CU, Ralf.
Read Message
Read Message
Read Message
Read Message yes.gif
Previous Topic:Problem using files with Cluster and CalorimeterHit collections
Next Topic:schema evolution with LCGenericObject
Goto Forum:

Current Time: Thu Feb 20 20:06:38 Pacific Standard Time 2020
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software