Re: opteron, VS2005 beta, win64: std::streamsize is 4 bytes?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"noel" <noel@xxxxxxxxxxxxxxxxxxxxxxxxx> skrev i meddelandet
news:32E8C63B-840C-4DCC-91E9-05E1DB25F720@xxxxxxxxxxxxxxxx
>i need to open files > 2GB. on two seperate platforms, i'm trying to
>compile
> a win32 console application that looks like:
>
> #include <fstream>
> #include <iostream>
> int main(void)
> {
> std::cout << sizeof(std::streamsize) << "\n";
> }
>
> that outputs 4. i want to open larger files, so i #define _WIN64 in
> the
> solution explorer. when i use this preprocessor definition, i get
> "size_t
> redefinition" errors.
>
> 1) how can i get an 8 byte std::streamsize on my opteron + win64 +
> VS 2005?
> 2) how can i get an 8 byte std::streamsize on this p4 + win2000 +
> VS 2003?

You can't. Streamsize cannot be larger than the largest integer type
in C++, which is long.

You can use larger files though, as long as you either read them
sequentially or seek with a distance smaller than 2 GB.



Bo Persson




.



Relevant Pages

  • Re: SHOW DEVICE/FILES with FORTRAN?
    ... >> I don't think that locks are involved. ... to to find a list of open files. ... typedef struct {unsigned int len; void *address;} desc; ... printf ("The search_devnam argument accepts the standard wildcard ...
    (comp.os.vms)
  • Re: printf()
    ... >> Out of curiosity, why do programmers ... No, they are not, even leaving aside the lack of a newline in the ... int main ... all open files are closed (hence all output ...
    (comp.lang.c)
  • Re: File Descriptors
    ... int rv = 0; ... fileopen: Too many open files ... Specify what platform you ran it on as well and precisely how you ...
    (comp.unix.programmer)
  • Re: Too Many Open Files --- error 24
    ... anything with libc or so? ... It is also behaving same way...! ... int main ...
    (comp.unix.programmer)
  • Re: VS 2003 compiling error
    ... > way to compile the solution even after I close and re-open the solution. ... This trick is very cumbersome and I loose all my settings ... > like open files, break points and all other IDE settings. ...
    (microsoft.public.vsnet.general)