Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-02-03 11:24:56


I've added a file_size() function to the CVS HEAD.

It has been tested only on Windows. It hasn't even been compiled on other
systems.

Testing is a bit difficult. The regular operations_test has been updated to
cover several cases, but it would place a burden on testers to test the
cases of file sizes requiring 32-bit and greater than 32-bit
representations. In other words:

   * File sizes between 2,147,483,648 and 4,294,967,295.
   * File sizes greater than 4,294,967,295.

boost-root/libs/filesystem/example now contains a program file_size.cpp and
a simple Jamfile to build it. Of course it can also be build with your
favorite make tool or IDE. When invoked from the command line with a
(native) file path, it will display the size of the file in bytes. To know
if the value is correct, you have to look at the file size with some system
specific tool such as "dir", "ls", or a graphical file explorer.

It works with large files on Windows, using Borland 0x0564, CodeWarrior
8.3, GCC 3.3.1 cygming special, Intel 8.0, Microsoft 7.0 and 7.1. It fails
to compile on VC++6.0 because of limited 64-bit support.

I'd appreciate hearing test results on other systems, particularly a
variety of POSIX systems. If it doesn't work for large files on your
system, suggestions to get it working will be much appreciated.

Thanks,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk