Re: "ANSI bad file tag"....cannot read certificate

From: S R Tripathy (shakti_at_acm.org)
Date: 11/23/04


Date: Tue, 23 Nov 2004 12:19:40 -0000

Try calling the "reset" function on the stream before reading

Rgds
Shakti
"shahid" <fake@microsoft.com> wrote in message
news:ejYoJEU0EHA.2568@TK2MSFTNGP11.phx.gbl...
> Hi all,
>
> i am trying to read a certificate serialized on the hard disk. when i try
to
> read this certificate using ifstream, "ANIS bad file tag" message is
> displayed.
> i am using the following code:
>
> ifstream certIn;
> certIn.open("C:\\atemp.cer");
> certIn.seekg(0,ios::end);
> int nSize = certIn.tellg();
> certIn.seekg(0,ios::beg);
> char cert[nSize];
> certIn.read(cert,nSize);
> certIn.close();
>
> Regards
>
>



Relevant Pages

  • Re: Reading Simple Flatfiles with a COBOL Mindset
    ... I am new to C and old to COBOL ... > in with respect to reading a simple file - one record at a time. ... stream and impose your interpretation on them: ... there are text streams and binary streams. ...
    (comp.lang.c)
  • Re: Reading from standard input
    ... I finally understood the concept of '-' stream. ... I am learning perl scripting and was reading an online tutorial where i ... Can somebody explain me why reading from the standard input ...
    (comp.lang.perl.misc)
  • StreamReader.Read blocking?
    ... spawn threads that handle the reading of the streams by placing the stream ... Debug.WriteLine("Started reading standard output."); ... characters are read, or the end of the file is reached. ... About ReadBlock(), MSDN says: The method blocks until either count ...
    (microsoft.public.dotnet.framework)
  • StreamReader.Read blocking?
    ... spawn threads that handle the reading of the streams by placing the stream ... Debug.WriteLine("Started reading standard output."); ... characters are read, or the end of the file is reached. ... About ReadBlock(), MSDN says: The method blocks until either count ...
    (microsoft.public.dotnet.framework)
  • StreamReader.Read blocking?
    ... spawn threads that handle the reading of the streams by placing the stream ... Debug.WriteLine("Started reading standard output."); ... characters are read, or the end of the file is reached. ... About ReadBlock(), MSDN says: The method blocks until either count ...
    (microsoft.public.dotnet.framework)