From owner-freebsd-hackers Wed Aug 1 19:56:59 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by hub.freebsd.org (Postfix) with SMTP id E1D7537B403 for ; Wed, 1 Aug 2001 19:56:54 -0700 (PDT) (envelope-from kc5vdj@yahoo.com) Received: from mkc-65-28-47-209.kc.rr.com (HELO yahoo.com) (65.28.47.209) by smtp.mail.vip.sc5.yahoo.com with SMTP; 2 Aug 2001 02:56:54 -0000 X-Apparently-From: Message-ID: <3B68C175.E8E8D444@yahoo.com> Date: Wed, 01 Aug 2001 21:56:53 -0500 From: Jim Bryant Reply-To: kc5vdj@yahoo.com X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Joseph Gleason Cc: Alex Zepeda , hackers@FreeBSD.ORG Subject: Re: Finding filesizes in C++ for files greater than 4gb References: <00b201c11af3$4fef1c10$0a2d2d0a@battleship> <20010801184531.A7725@zippy.mybox.zip> <003c01c11afb$3cdc7980$0a2d2d0a@battleship> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joseph Gleason wrote: > > ----- Original Message ----- > From: "Alex Zepeda" > To: "Joseph Gleason" ; > 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. jim -- ET has one helluva sense of humor! He's always anal-probing right-wing schizos! _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message