Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0014472 [FPC] RTL major always 2009-09-01 08:08 2009-09-02 09:24
Reporter Giorgio Tani View Status public  
Assigned To Marco van de Voort
Priority normal Resolution no change required  
Status resolved   Product Version 2.2.2
Summary 0014472: Incorrect file size reported in .Size of TSearchRec, for files larger than 4GB (Win32)
Description If the size of a file larger than 4GB is obtained calling FindFirst and using .Size field of TSearchRec, as in the example, it is reported incorrectly, based only on the lower 4 bytes.
With filesize function (either the one using the filename, or the one using the pointer to the file) the correct filesize is reported.
Additional Information Tested on Vista SP2 32 bit
Tags No tags attached.
FPCOldBugId 0
Fixed in Revision
Attached Files zip file icon test.zip [^] (345,237 bytes) 2009-09-01 08:08
? file icon sysutils.o [^] (368,418 bytes) 2009-09-01 21:15
? file icon sysutils.ppu [^] (195,804 bytes) 2009-09-01 21:15

- Relationships
has duplicate 0013504resolvedMarco van de Voort Sysutils: FindMatch Wrong file size for big files in Windows. 

-  Notes
(0030297)
Giorgio Tani (reporter)
2009-09-01 21:08

Line 383 of Function FindMatch in sysutils (the version included in Lazarus 0.9.26.2) seem responsible of this problem:

f.size:=F.FindData.NFileSizeLow;

I don't know if the issue was resolved in subsequent SVN versions, however I've modified that line in:
f.size:=(int64(F.FindData.NFileSizeHigh) shl 32)+F.FindData.NFileSizeLow;

After I re-compiled the sysutils.o and sysutils.ppu, and replaced the ones in lazarus\fpc\2.2.2\units\i386-win32\rtl path, I can compile my projects and now the size reported in TSearchRec perfectly match filesize function.
(0030298)
Giorgio Tani (reporter)
2009-09-01 21:18

Sorry for the duplicate report, I was searching in the Lazarus tracker where I originally posted instead that in FPC ones, so I didn't noticed the same issue was resolved here:
http://bugs.freepascal.org/view.php?id=13504 [^]
Anyway I've uploaded the compiled .o and .ppu to be placed in lazarus\fpc\2.2.2\units\i386-win32\rtl path if some Lazarus users are interested in a quick fix to be applied to the IDE; my bug report IMHO can be closed.
(0030310)
Marco van de Voort (manager)
2009-09-02 09:24

Indeed a bugfix is already in svn

- Issue History
Date Modified Username Field Change
2009-09-01 08:08 Giorgio Tani New Issue
2009-09-01 08:08 Giorgio Tani File Added: test.zip
2009-09-01 09:01 Vincent Snijders Project Lazarus => FPC
2009-09-01 09:03 Vincent Snijders FPCOldBugId => 0
2009-09-01 09:03 Vincent Snijders Category Other => RTL
2009-09-01 09:03 Vincent Snijders os => Windows
2009-09-01 09:03 Vincent Snijders os_build => Vista SP2 32 bit
2009-09-01 09:03 Vincent Snijders platform => i386
2009-09-01 09:03 Vincent Snijders version 0.9.26.2 => 2.2.2
2009-09-01 11:54 Jonas Maebe Summary Incorrect file size reported in .Size of TSearchRec, for files larger than 4GB => Incorrect file size reported in .Size of TSearchRec, for files larger than 4GB (Win32)
2009-09-01 21:08 Giorgio Tani Note Added: 0030297
2009-09-01 21:15 Giorgio Tani File Added: sysutils.o
2009-09-01 21:15 Giorgio Tani File Added: sysutils.ppu
2009-09-01 21:18 Giorgio Tani Note Added: 0030298
2009-09-02 09:23 Marco van de Voort Relationship added has duplicate 0013504
2009-09-02 09:24 Marco van de Voort Status new => resolved
2009-09-02 09:24 Marco van de Voort Resolution open => no change required
2009-09-02 09:24 Marco van de Voort Assigned To => Marco van de Voort
2009-09-02 09:24 Marco van de Voort Note Added: 0030310



Mantis 1.1.1[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker