Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2001 07:18:44 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Joseph Gleason <clash@tasam.com>
Cc:        FBSD-Q <freebsd-questions@FreeBSD.ORG>
Subject:   Re: filesizes greater than 4gb
Message-ID:  <20010802071844.A16931@student.uu.se>
In-Reply-To: <002b01c11aee$21b9ae00$0a2d2d0a@battleship>
References:  <002b01c11aee$21b9ae00$0a2d2d0a@battleship>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010802071844.A16931>