I do not yet know if this problem (feature?) persists in other clx
components as well.
The files are created on a ReiserFS 3.6 (SuSE 9) filesystem, so large files
are supported
Not only selecting files using Opendialog fails. Obtaining file size or
seeking inside a large (>2GB) file also fails. I do use large enough
records, so that the record counter does not exceed 32 bits.
Some code snippets:
FImageBlock = array[1..1024] of Word; // Read file per singe line from
image
...
Fimg: FILE OF FImageBlock;
AssignFile(Fimg, 'somefile');
...
Reset(Fimg); Resetting works fine
...
Size := FileSize(Fimg); Reading size doesn't: IOResult = "Value
too large for defined data type"
Thanks in advance for any help
This first seems to be a problem of the Qt Version.
<cite>
Qt 3.1 introduces many significant new features and many improvements
over the 3.0.x series.
...
- Large File support: Qt's internals have been modified to support
Large Files (> 2GB). QFileDialog will now correctly display and
select large files.
</cite>
The second problem:
Have you tried TFileStream.Size ? I think it should work > 2GB but have
not tested it.
According to Yast the system uses the Qt 3.2.1 library, which I suppose
should be new enough . Does Kylix perhaps uses its own library?.
On the second problem:
I have now tried to use the TFileStream class, which
indeed seemed promissing, since the seek and size implementations both
use int64 indexing. I am able to open huge files with the library, However,
the file size is always cut off at 2Gb, and seeking beyond this limit does
not
work.
I made a simple example to clarify this post which can be found on
http://willow.phys.tue.nl/thijs/largefiles.zip
The program is the source of a very basic file viewer (actually part of the
program
i am working on). It reads raw-image data (1024*1024*16bit) and displays it.
If anybody would be so nice to try it, it can, of course, also read other
binary files.
Image 1024 coincides with the 2GB limit. This means that at image 1024
the seek procedure fails, and image 0 is returned.
I realize that the topic has shifted from the clx component alone, but i
still hope
someone would be able to help me.
> Does Kylix perhaps uses its own library?.
Yes, it uses Qt 2.1 (and can be linked against Qt 2.3)
> I have now tried to use the TFileStream class, which
> indeed seemed promissing, since the seek and size implementations both
> use int64 indexing.
This is only because the Classes unit is a "copy" of the Windows version
Classes unit. The function that is invoked by the TFileStream are limited
to Integers. In the Libc unit you will find 64 Bit versions of the Linux
functions. But then you must call them by hand or you derive a new
TFile64Stream from TStream.
--
Regards,
Andreas Hausladen
(http://www.kylix-patch.de.vu - unofficial Kylix 3 patches)
> Yes, it uses Qt 2.1 (and can be linked against Qt 2.3)
Sorry to be asking all these beginner questions, but is it also possible to
link kylix against QT 3.xx ?
I'm asking this since Theo (2 posts ago) noted that at least Qt 3.1 is
necessary. Andreas: I saw on your
Kylix patches website (looks great!) that you are in the process of writing
Qt3 for Kylix units.
Would I need those, just for simple forms and an open dialog object?
> This is only because the Classes unit is a "copy" of the Windows version
> Classes unit. The function that is invoked by the TFileStream are limited
> to Integers. In the Libc unit you will find 64 Bit versions of the Linux
> functions. But then you must call them by hand or you derive a new
> TFile64Stream from TStream.
I'm not that familiar with Libc API calls, but I just tried Ray Lischner's
STDIO library, which invokes Libc calls. The library used the
fseeko64 call, which should allow for 64 bit adressing, but still the
program
would not allow for >2GB adressing. I changed open into open64,
(I could not find more 64 bits equivalents), but to no avail.
Again I uploaded simple example to clarify this post
http://willow.phys.tue.nl/thijs/largefiles2.zip
Regards, Thijs Elenbaas
> Sorry to be asking all these beginner questions, but is it also possible
> to link kylix against QT 3.xx ?
> I'm asking this since Theo (2 posts ago) noted that at least Qt 3.1 is
> necessary. Andreas: I saw on your
> Kylix patches website (looks great!) that you are in the process of
> writing Qt3 for Kylix units.
> Would I need those, just for simple forms and an open dialog object?
The Qt3 for Kylix units allow you to write Qt 3 application. This does not
mean that you can use the VisualCLX for writing your application. The
VisualCLX depends on Qt 2. And the Qt 3 and Qt 2 shared object cannot be
loaded at the same time in one process. So it does not work.
Does anybody have experience with this?