[Box Backup] Re: Q: Large files OK? i.e. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE

Matt Lawson boxbackup@fluffy.co.uk
Fri, 22 Oct 2004 10:30:33 -0400


>
>
>--__--__--
>
>Message: 8
>From: Ben Summers <ben@fluffy.co.uk>
>Subject: Re: [Box Backup] Q: Large files OK? i.e. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>Date: Fri, 22 Oct 2004 09:15:12 +0100
>To: boxbackup@fluffy.co.uk
>Reply-To: boxbackup@fluffy.co.uk
>
>
>On 21 Oct 2004, at 22:53, 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.
>
>Thanks!
>
>Ben
>
>
>
>
>--__--__--
>

The site that I found was:

http://www.suse.de/~aj/linux_lfs.html

Searching for "Large file support Linux" in Google.


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.

- Matt