www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5452] New: Signed file lengths and positions


           Summary: Signed file lengths and positions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc

--- Comment #0 from bearophile_hugs eml.cc 2011-01-13 16:15:53 PST ---
In File size() returns an ulong, given by seek():

It uses fseek, that seems to return a signed value:

So isn't it better and safer if those functions of File return a long instead
of an ulong?

See also bug 3843 but here the values are 64 bit, so while 4 GB arrays of bytes
are possible, files of just 9_223_372_036_854_775_807 bytes are not a
significant limitation compared to files 18_446_744_073_709_551_615 bytes long.

Currently unsigned values are quite dangerous in D, so I suggest to avoid
introducing them in Phobos unless where they are necessary.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 13 2011