fix handling >=2GiB files on 32-bit systems