From owner-freebsd-hackers Wed Aug 1 18:41:45 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 188A837B401 for ; Wed, 1 Aug 2001 18:41:43 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id EB21181D06; Wed, 1 Aug 2001 20:41:32 -0500 (CDT) Date: Wed, 1 Aug 2001 20:41:32 -0500 From: Alfred Perlstein To: Joseph Gleason Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Finding filesizes in C++ for files greater than 4gb Message-ID: <20010801204132.K26571@elvis.mu.org> References: <00b201c11af3$4fef1c10$0a2d2d0a@battleship> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <00b201c11af3$4fef1c10$0a2d2d0a@battleship>; from clash@tasam.com on Wed, Aug 01, 2001 at 09:34:43PM -0400 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 [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 st_dev; /* inode's device */ ... off_t st_size; /* file size, in bytes */ off_t is 64 bits under FreeBSD. A bunch of other unix systems have alternate system calls to get 64bit attributes for files. -- -Alfred Perlstein [alfred@freebsd.org] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message