|
Boost Users : |
From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-09-16 13:03:24
me22 wrote:
>Some further numbers about the double precision: Using the 24-bit
>mantissa floats, that means +/- 16 KB for a 16 GB measurement, or +/-
>16 MB on a 16 TB measurement. For the 53-bit mantissa double, that
>same 16-TB measurement could be accurate to +/-0.001953125 bytes :P
>
>The one drawback would be that summing entries could be victim to
>round-off error, of course.
>
I wonder why do people want to be able to find out how much disk space
is available, programmatically. Presumably the intent is to find out
whether there will be enough space to create the files they intend to.
In that case, round-off entry is an unimportant source of error,
compared to:
1. The existence of quotas that limit disk usage further
2. Overheads for file metadata
3. Other concurrent processes using or freeing space on the volume
4. Resizing of the volume
I'm really unconvinced that this function is useful as-is in portable
programs. It seems to me that it would be more useful to provide a
function that makes a best guess as to whether files of given
names/paths and sizes could be created successfully. That could take
into account 1 and 2 on at least some platforms.
Ben.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net