Hi,
Thanks for your suggestions. I will try this today. As you have
probably figured out, I am not an engineer first, and a programmer
second. Your suggestion about ofstream being the wrong tool has come
time mind before, but I wouldn't know what else to use...besides a
standard C stream....or just an fstream? So yes i just write binary
files....what would be a more appropriate tool?
Thanks
Randy
On Feb 8, 12:35 pm, James Kanze <james.ka...@[EMAIL PROTECTED]
> wrote:
> On Feb 8, 8:50 pm, rrsettg...@[EMAIL PROTECTED]
wrote:
>
>
>
> > On Feb 8, 11:24 am, "Daniel T." <danie...@[EMAIL PROTECTED]
> wrote:
> > > How many is "a bunch"? Are you sure they are all getting closed
proper=
ly?
> > Like 10.
> > Yes they are all closed.
> > I do the following commands:
> > cout<<" output.is_open() =3D "<<output.is_open()<<endl;
> > cout<<" output.fail() =3D "<<output.fail()<<endl;
> > cout<<" output.bad() =3D "<<output.bad()<<endl;
> > cout<<" output.good() =3D "<<output.good()<<endl;
> > before and after the output.open( filename , ios::binary | ios::out |
> > ios::trunc ); call.
> > i get:
> > before open command
> > output.is_open() =3D 0
> > output.fail() =3D 0
> > output.bad() =3D 0
> > output.good() =3D 1
> > after open command
> > output.is_open() =3D 0
> > output.fail() =3D 1
> > output.bad() =3D 0
> > output.good() =3D 0
> > Any way to tell exactly why the open fails?
>
> Not ****tably, but on most implementations, reading errno
> immediately after the open fails (without any intervening code)
> will give a good idea. Something like:
>
> stream.open( filename ) ;
> if ( ! stream ) {
> int err =3D errno ;
> std::cerr << "open of " << filename << " failed: "
> << strerror( err ) << std::endl ;
> }
>
> One note, however: in your original posting, you said you were
> outputting binary files. Are you sure ofstream is the right
> tool; it does text formatting, not binary (and it seems a bit
> overweight if the only function in it you use is write()).
>
> --
> James Kanze (GABI Software) email:james.ka...@[EMAIL PROTECTED]
> Conseils en informatique orient=E9e objet/
> Beratung in objektorientierter Datenverarbeitung
> 9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34


|