Re: Ada.Directories.Size wraps on over 2Gb files



On Dec 10, 8:29 pm, "Randy Brukardt" <ra...@xxxxxxxxxxxxxx> wrote:
<gp...@xxxxxxxxx> wrote in message

news:0db40dde-17f0-40a9-9dc0-55f9b0a8e1b1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Ada.Directories.Size wraps on over 2Gb files returning negative
number. I saw that was mentioned in

Sounds like a compiler bug. Ada.Directories.Size is supposed to return the
correct answer or Constraint_Error. Constraint_Error only if the type
File_Size can't hold the value (for instance, if it is 32-bits on a compiler
that only supports 32-bit integers). You didn't say what compiler that you
are using, but you should contact your vendor.

BTW, it isn't possible for Ada.Directories.Size to return a negative number
unless something is *really* screwed up, because type
Ada.Directories.File_Size does not include negative numbers. They'd have to
have suppressed range checking of the result...

Randy.

I am using:

GPS 4.1.3 (20070913) hosted on pentium-mingw32msv
GNAT GPL 2007 (20070405-41)

with following:

type File_Size is range 0 .. Long_Long_Integer'Last;
-- The type File_Size represents the size of an external file

Range checks might been suppressed in the library.
.