[Qt-interest] Large File Support

Thiago Macieira thiago.macieira at trolltech.com
Tue Jul 28 09:16:22 CEST 2009


James Matta wrote:
>I know that in Qt4 large file support is on by default but I have a few
>questions about how it is handled in certain cases.
>
>Namely, suppose the program is being used on a system that doesn't have
>large file support. Perhaps it is a 32 bit linux. Or perhaps it is some
>weird USB external hard drive.

32-bit Linux and any external hard drives have large file support.

If you mean Linux 2.0, Qt doesn't run there anymore. So you can expect 
large file support to be present in any Linux, except if you're using a 
libc that is far too limited.

But, if you are, I doubt that you care about multi-gigabyte files.

>In this case how does Qt create large files? Does it break them into
>appropriately sized chunks and simply number them so that 1 filename can
> be used to access them? Does it simply throw an exception?

If the large file support isn't enabled, your application will get SIGXFSZ 
and will crash after trying to write past 2 GB. If it doesn't crash, it 
will suffer data loss.

Now, if you try to write a large file (with proper OS support) to a 
filesystem that can't handle it, write(2) will simply fail and you'll get 
those errors in QFile.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090728/38c633b9/attachment.bin 


More information about the Qt-interest-old mailing list