Re: Ada.Directories.Size wraps on over 2Gb files
- From: gpriv@xxxxxxxxx
- Date: Mon, 10 Dec 2007 17:36:03 -0800 (PST)
On Dec 10, 8:29 pm, "Randy Brukardt" <ra...@xxxxxxxxxxxxxx> wrote:
<gp...@xxxxxxxxx> wrote in message
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...
I am using:
GPS 4.1.3 (20070913) hosted on pentium-mingw32msv
GNAT GPL 2007 (20070405-41)
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.