Jim Bryant wrote:
>
> Joseph Gleason wrote:
> >
> > ----- Original Message -----
> > From: "Alex Zepeda" <[EMAIL PROTECTED]>
> > To: "Joseph Gleason" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 01, 2001 21:45
> > Subject: Re: Finding filesizes in C++ for files greater than 4gb
> >
> > > On Wed, Aug 01, 2001 at 09:34:43PM -0400, Joseph Gleason wrote:
> > >
> > > > In FreeBSD, how can I determine the size of a file in C++ when the file
> > is
> > > > greater than 4gb?
> > > >
> > > > Currently, I use stat() and use st_size. That is limited to 4gb (32bit
> > > > unsigned int)
> > >
> > > You're wrong. Read the man page. No soup for you! Next!
> > >
> > > - alex
> >
> > Alright, I made a mistake. But I did read the man page. Where does it say
> > off_t is 64bits?
> >
> > My mistake was not digging through the include files enough to see what was
> > going on.
>
> I think you got him on that, but [cut and paste of two consecutive lines from the
>manpage]...
>
> off_t st_size; /* file size, in bytes */
> int64_t st_blocks; /* blocks allocated for file */
>
> If the manpage specifies int64_t for the blocks, even though off_t isn't specified
>in the manpage, what does it lead you to assume?
>
> Although 64-bit file sizes have been part of FreeBSD since 2.0-RELEASE back in 1994
>[as I recall], maybe the manpages should reflect
> this fact by means other than the deductive reasoning outlined above. Joseph has
>made a good point.
Just so someone can see it.
coral# grep BSD_OFF *.h
ansi.h:#define _BSD_OFF_T_ __int64_t /* file offset */
coral# pwd
/usr/include/machine
Kent
--
Kent Stewart
Richland, WA
mailto:[EMAIL PROTECTED]
http://kstewart.urx.com/kstewart/index.html
FreeBSD News http://daily.daemonnews.org/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message