[osgeo4w-dev] [osgeo4w] #454: overflow with ls

OSGeo4W trac_osgeo4w at osgeo.org
Sun Jan 25 17:39:47 PST 2015


#454: overflow with ls
--------------------+-------------------------------------------------------
Reporter:  mwtoews  |       Owner:  osgeo4w-dev@…              
    Type:  defect   |      Status:  new                        
Priority:  major    |   Component:  Package                    
 Version:           |    Keywords:                             
--------------------+-------------------------------------------------------
 With the 64-bit version of OSGeo4W, I'm seeing overflow with the `ls`
 utility while inspecting files larger than 4 GB. For instance, write three
 files that are near the 4 GB size where this is an issue, e.g. with Python
 {{{
 import os
 os.chdir(r'C:\temp')
 with open('f1.tmp', 'wb') as f:
     f.write(b'\x00' * (2 ** 32 - 1))
 with open('f2.tmp', 'wb') as f:
     f.write(b'\x00' * (2 ** 32))
 with open('f3.tmp', 'wb') as f:
     f.write(b'\x00' * (2 ** 32 + 1))
 }}}
 Now with either MSYS or the CMD.EXE-based OSGeo4W Shell (shown):
 {{{
 C:\Temp>dir *.tmp
  Volume in drive C is Windows
  Volume Serial Number is C0A8-5CF4

  Directory of C:\Temp

 26/01/2015  02:14 p.m.     4,294,967,295 f1.tmp
 26/01/2015  02:13 p.m.     4,294,967,296 f2.tmp
 26/01/2015  02:27 p.m.     4,294,967,297 f3.tmp
                3 File(s) 12,884,901,888 bytes
                0 Dir(s)  13,467,774,976 bytes free

 C:\Temp>ls -l *.tmp
 -rw-r--r-- 1 mtoews Administrators 4294967295 Jan 26 14:14 f1.tmp
 -rw-r--r-- 1 mtoews Administrators          0 Jan 26 14:13 f2.tmp
 -rw-r--r-- 1 mtoews Administrators          1 Jan 26 14:27 f3.tmp

 C:\Temp>where ls
 C:\OSGeo4W\apps\msys\bin\ls.exe
 }}}

 Other tools like `wc` show the correct number of bytes, so I'm not sure
 where the issue is exactly or what other tools to check. I haven't checked
 with the 32-bit version of OSGeo4W either.

-- 
Ticket URL: <http://trac.osgeo.org/osgeo4w/ticket/454>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list