#492 SysFileTree fails on files > 4Gb

closed
Mark Miesfeld
None
5
2012-08-14
2008-01-29
Geoff Stevens
No

OORexx v3.1.2 for LINUX on Debian Etch

SysFileTree returns some odd numbers for the file size of files larger than 4Gb. Looks like a 32bit overflow.

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2010-08-12

    Many programs parse the output of SysFileTree based on column position. Extending the file size field to 64 bit would break backward compatibility.

    Because of that the development team has made the decision to not alter SysFileTree in regards to the default output with the file size included.

    In ooRexx 4.0.0 an on, the .Stream class will correctly report file size greater than 4 GB. In addition, the next major release of ooRexx should include a .File class that will also correctly report the file size.

    For example, here's a program that will search a directory tree and report all files greater than 4GB:

    !/usr/bin/rexx

    / Report all files greater than 4 GB (4,294,967,295) in a directory tree /

    j = SysFileTree('*', files., 'FOS')
    do i = 1 to files.0
    fObj = .stream~new(files.i)
    s = fObj~query('SIZE')
    if s > 4294967295 then do
    say 'Size:' s~right(20) files.i
    end
    end

     


Anonymous


Cancel   Add attachments