| re: fstream::open & seg fault
I checked with gdb, and this is what I get (is definetly comming from the
call to open ):
[...]
at
/scratch/happi/GNU.LANG/gcc-alt-3.2/i686-pc-linux-gnu/libstdc++-v3/include/b
its/ios_base.h:123
123
/scratch/happi/GNU.LANG/gcc-alt-3.2/i686-pc-linux-gnu/libstdc++-v3/include/b
its/ios_base.h: No such file or directory.
Somehow the file name I am passing as an argument is not being found. I
tried everything (i.e. absolute path names, etc...)
The paths are unix like(i.e /home/user), so I am passing arguments like :
myFile.open("/home/user/myfile.txt")
is this correct?
Regards
Manuel
"Manuel Maria Diaz Gomez" <Manuel.Maria.Diaz.Gomez@cern.ch> wrote in message
news:cdjddq$ca6$1@sunnews.cern.ch...[color=blue]
> Hi everybody,
>
> This is probably trivial, but I just can't see it.
> In the followinf function:
>
> /*-------------------------------------------------*/
> File::loadFile(string inputFile)
> /*-------------------------------------------------*/
> {
> ifstream myFile;
>
> myFile.open(inputFile.c_str());
> .....
> }
>
> I get a segmentation fault when invoking the open( fstream::open)[/color]
function.[color=blue]
> I verified that inputFile.c_str() is returning the right value, so...
>
> Does someone has any hints about it?
>
> Regards
> Manuel
>
>
> --
> ================================================== ======================
> Manuel Diaz-Gomez | ATLAS Bldg. 32/SB-008 tel. +41 22 76 76304
> CERN EP Division
> CH-1211 Geneva 23
> SWITZERLAND
> ================================================== ======================
>
>[/color] |