PDA

View Full Version : Possible wrong Result of "Calculate Cumulative File Size"



NewsArchive
05-20-2010, 01:21 AM
Hi Friedrich,

it seems that the following script holds a wrong value in %SEARCHSIZE%
if the cumulative size exceeds 2GB.

Set Variable %SEARCHRESULT% to FUNCTION:Handle File Listing(Free
File List)
Set Variable %SEARCHRESULT% to FUNCTION:Handle File Listing(Load
File List, 1) of "%DATENTOUPDATEDIR%\*.BDB"
Set Variable %SEARCHSIZE% to FUNCTION:Handle File
Listing(Calculate Cumulative File Size)
Set Variable %SEARCHRESULT% to FUNCTION:Handle File Listing(Free
File List)

Could you check this please?

Thanks in advance.
Markus

NewsArchive
05-20-2010, 01:21 AM
Markus,

> it seems that the following script holds a wrong value in %SEARCHSIZE% if
> the cumulative size exceeds 2GB.

Yes, that's possible. 2GB is the maximum here. We'll add this to the
documentation, thank you.

Friedrich

NewsArchive
05-20-2010, 01:21 AM
No, the function can handle 4GB, but the variable that receives the value
can only handle 2GB. We'll check if we can change this behavior.

Friedrich

NewsArchive
05-20-2010, 01:22 AM
Hi Friedrich,

this means, your(?) function uses an unsigned int and the script
variable is a signed int.

Is it possible to calculate with kBytes instead of bytes? So the limit
would be 2/4TB.

I ask this because 4GB is insufficient too in my case. I have customers
with more than 10GB...

Markus

NewsArchive
05-20-2010, 01:22 AM
Hi Markus,

> this means, your(?) function uses an unsigned int and the script variable
> is a signed int.

Yes, that's correct.

> Is it possible to calculate with kBytes instead of bytes? So the limit
> would be 2/4TB.
>
> I ask this because 4GB is insufficient too in my case. I have customers
> with more than 10GB...

The runtime can't handle values >4GB. Quite a few used Windows APIs do not
support Quad (U64) unsigned integer numbers.

Friedrich

NewsArchive
05-20-2010, 01:23 AM
Yes, this is surely true for a single file.

But what I thinked about is already possible within SB script, as long
as a single file is not larger than 2GB, but it's to slow:

- Get File List
- %ACCUMULATED_SIZE_IN_KB% = 0
- For each entry in the file list do
- - Get File Size and store in %FILESIZE%
- - %FILESIZE% = %FILESIZE% / 1024
- - %ACCUMULATED_SIZE_IN_KB% = %ACCUMULATED_SIZE_IN_KB% + %FILESIZE%

Should I really do that in SB script? What, if my file list (718 files)
is larger than 10kb?

Markus

NewsArchive
05-20-2010, 01:23 AM
Hi Markus,

I think what should work is a new "Calculate Cumulative File Size (KB)"
option that calculates the cumulative file size (in KB). I have added it to
the whishlist.

Friedrich

NewsArchive
05-20-2010, 01:24 AM
Thanks.

Markus Zander

NewsArchive
05-22-2010, 07:24 AM
Update: The Get File Size functionality in SetupBuilder supports quad (U64)
unsigned integer numbers now.

Friedrich

NewsArchive
05-22-2010, 07:24 AM
As always: Great

Markus Zander

NewsArchive
07-15-2010, 01:20 AM
Works in your actual build.

Thanks.

Markus Zander

NewsArchive
07-15-2010, 01:21 AM
>
> Works in your actual build.
>

Thank YOU!

Friedrich