Re: How to read large files with VC6



LM wrote:
> Hi all.
> I am making a file utility for my self with Visual C v6.
> It works but when I tried to give it a 3GB file it gave
> an error. I know about that limitation in Win98. Still
> for many reasons I prefer VC6 over VC.net. So, is there
> an easy way read/write large file in VC6.
>
> Parts of code:
>
> long file1l;
>
> stream1=fopen(filename,"rb");
> if (stream1==NULL) {
> return 1;
> }
>
> file1l=ftell(stream1);
> if (file1l==-1) {
> return 2; //This seems to give an
> error }
>
> numberofbytes=fread(fbuffer+locb2,1,file2-locf2,stream2);
>
>
> I am using XP pro sp2.

What's the value of errno? Probably fo files that big you
should use _telli64 and _lseeki64.




.



Relevant Pages

  • Re: Can you write code directly in CIL ???
    ... anyway if it's true I would suggest you to file a bug report ... I can prove that the newest C++ compiler produces equal or better ... code than VC6. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • DLLMain in assemblies?
    ... is there a mechanism just like DllMain in VC6, ... Jozsi ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • IMimeMessage interface
    ... I try build application with IMimeMessage Interface in VC6++, ... Missing mimeole.h file. ... Ervin ... Prev by Date: ...
    (microsoft.public.win32.programmer.messaging)
  • Multithreading in COM?
    ... What conditions one COM object have to satisfy to be called with multiple ... I'm using VC6. ... Prev by Date: ...
    (microsoft.public.vc.atl)
  • IMimeMessage interface
    ... I try build application with IMimeMessage Interface in VC6++, ... Missing mimeole.h file. ... Ervin ... Prev by Date: ...
    (microsoft.public.vc.mfc)

Loading