[Box Backup] Re: Q: Large files OK? i.e. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Ben Summers
boxbackup@fluffy.co.uk
Fri, 22 Oct 2004 15:42:13 +0100
On 22 Oct 2004, at 15:30, Matt Lawson wrote:
>>>> Howdy,
>>>>
>>>> Does boxbackup currently support large files >2G, 4G, etc? I would
>>>> expect to see the -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>>>> switches in there but I don't.
>>>>
>>>> Also, is there any reason to think that compiling with these
>>>> switches would cause any trouble?
>>>
>>
>> Box Backup fully supports large files. All file size calculation and
>> storage is done with 64 bit integers. However, if the OS only gives
>> it 32 bit sizes, then it is limited in what it can do.
>>
>> I'm not a Linux expert, as I work on BSD-based systems. If some
>> command line parameters are required to get Linux to give 64 bit file
>> sizes, then could you...
>>
>> * Point me to some documentation about the issue
>>
>> * Tell me how to detect an OS which requires these switches
>>
>> * Tell me where exactly the switches should be applied.
>>
>> and then I'll adjust the build scripts to do the necessary work.
>
> The site that I found was:
>
> http://www.suse.de/~aj/linux_lfs.html
>
> Searching for "Large file support Linux" in Google.
Ah, that's the magic set of keywords.
>
>
> I was writing some functions for opening, seeking, and determining the
> size of files (not part of BoxBackup itself). Initially, it did not
> work with large files. I applied the -D_FILE_OFFSET_BITS=64
> -D_LARGEFILE_SOURCE switches as part of my compiler options and that
> fixed it. I also had to change fseek to fseeko and ftell to ftello
> and use the data type off_t with those functions, as described in the
> website.
>
> Because we also use boxbackup, though, I was wondering if that was an
> issue and if the large file switches should or should not be applied
> there as well.
That sounds like an awful lot of unnecessary fun. Still, I'll get a
test added for Linux LFS, and insert the necessary hacks.
I will not rant about Linux now, but please assume I have made my usual
comments about it.
Ben