From owner-freebsd-questions Wed Aug 1 22:19:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailb.telia.com (mailb.telia.com [194.22.194.6]) by hub.freebsd.org (Postfix) with ESMTP id 6A7D637B401 for ; Wed, 1 Aug 2001 22:19:44 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailb.telia.com (8.9.3/8.9.3) with ESMTP id HAA08251 for ; Thu, 2 Aug 2001 07:19:43 +0200 (CEST) Received: from ertr1013.student.uu.se (h185n2fls20o913.telia.com [212.181.163.185]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id HAA21519 for ; Thu, 2 Aug 2001 07:19:42 +0200 (CEST) Received: (qmail 16998 invoked by uid 1001); 2 Aug 2001 05:18:44 -0000 Date: Thu, 2 Aug 2001 07:18:44 +0200 From: Erik Trulsson To: Joseph Gleason Cc: FBSD-Q Subject: Re: filesizes greater than 4gb Message-ID: <20010802071844.A16931@student.uu.se> Mail-Followup-To: Joseph Gleason , FBSD-Q References: <002b01c11aee$21b9ae00$0a2d2d0a@battleship> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002b01c11aee$21b9ae00$0a2d2d0a@battleship> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 01, 2001 at 08:57:36PM -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) No. st_size has type off_t which is a 64 bit signed integer in FreeBSD. Using stat(2) should work fine. You could also use ftello(3) to get the size. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message