Re: Finding filesizes in C++ for files greater than 4gb

2001-08-04 Thread David O'Brien
On Wed, Aug 01, 2001 at 10:29:39PM -0500, Jim Bryant wrote: > Kent, my point is that the manual page should specify this. I think > that's the point the original poster was trying to make once he was > told. Well, either of you two submit a diff to the manpage and I'll commit it. It really isn't

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-02 Thread Warner Losh
In message <00b201c11af3$4fef1c10$0a2d2d0a@battleship> "Joseph Gleason" writes: : In FreeBSD, how can I determine the size of a file in C++ when the file is : greater than 4gb? stat(2). Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the m

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Terry Lambert
Chirag Kantharia wrote: > > On Wed, Aug 01, 2001 at 11:25:40PM -0700, Terry Lambert wrote: > | Uh, st_size is an off_t, which is a signed 64 bit value, > | not an unsigned 32 bit vale... > > why should it be `signed' 64 bit and not unsigned? Return value for lseek is off_t. -1 indicates error

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Greg Black
Chirag Kantharia wrote: | On Wed, Aug 01, 2001 at 11:25:40PM -0700, Terry Lambert wrote: | | Uh, st_size is an off_t, which is a signed 64 bit value, | | not an unsigned 32 bit vale... | | why should it be `signed' 64 bit and not unsigned? So that things like lseek(2) can return -1 as an error

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Chirag Kantharia
On Wed, Aug 01, 2001 at 11:25:40PM -0700, Terry Lambert wrote: | Uh, st_size is an off_t, which is a signed 64 bit value, | not an unsigned 32 bit vale... why should it be `signed' 64 bit and not unsigned? chyrag. -- Chirag Kantharia, slashetc.net/chyrag/ To Unsubscribe: send mail to [EMAIL

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Terry Lambert
Joseph Gleason wrote: > Alright, I made a mistake. But I did read the man page. Where does it say > off_t is 64bits? The same place it says char is 8 bits, short is 16 bits, and int and long are 32 bits: in your assumptions. It might be useful (for some definitions of "useful") to have a man p

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Terry Lambert
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) Uh, st_size is an off_t, which is a signed 64 bit value, not an unsigned 32 bit va

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Alex Zepeda
On Wed, Aug 01, 2001 at 10:31:22PM -0400, Joseph Gleason wrote: > 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. off_t st_size; /

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Jim Bryant
t;; <[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: > > > > > > > > >

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Kent Stewart
Jim Bryant wrote: > > Joseph Gleason wrote: > > > > - Original Message - > > From: "Alex Zepeda" <[EMAIL PROTECTED]> > > To: "Joseph Gleason" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Wednesday, August

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Jim Bryant
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+

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Joseph Gleason
> :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. > : > > The types(5) manpage will tell you this. > Ahh, thank you. I was not aware that existed.

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread David Scheidt
On Wed, 1 Aug 2001, Joseph Gleason wrote: : :- Original Message - :From: "Alex Zepeda" <[EMAIL PROTECTED]> :> 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? :> > :>

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Joseph Gleason
- 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,

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Alex Zepeda
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

RE: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Daniel O'Connor
On 02-Aug-2001 Joseph Gleason wrote: > Currently, I use stat() and use st_size. That is limited to 4gb (32bit > unsigned int) > > I could use st_blocks, but that wouldn't give me the exact size. > > (st_blocks -1) * 512 + (st_size % 512) > > This would make sense, but in tests st_bloc

RE: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread John Baldwin
On 02-Aug-01 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) struct stat { ... off_t st_size; /* fi

Re: Finding filesizes in C++ for files greater than 4gb

2001-08-01 Thread Alfred Perlstein
* Joseph Gleason <[EMAIL PROTECTED]> [010801 20:35] 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) No it's not: struct stat { dev_t