Opened 5 years ago

Closed 5 years ago

#11809 closed bug (fixed)

Tracker: info window: wrong file size (in bytes) for files > 2 GiB (2^31 bytes)

Reported by: andy-kras Owned by: pulkomandy
Priority: normal Milestone: R1/beta1
Component: Applications/Tracker Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: x86

Description

Tracker -> "Get Info" show wrong file size (in bytes) for file sizes more than 2 GiB.

You can see it for file /boot/system/var/swap, for example.

Just set virtual memory size 2.01 Gib and reboot.

Then get file info in Tracker and see negative file size (-2,140,143,616 bytes).

Tested on last nightly hrev48745 x86_gcc2_hybrid and hrev48744 x86_64

Attachments (1)

screenshot1.png (51.8 KB ) - added by andy-kras 5 years ago.

Download all attachments as: .zip

Change History (4)

by andy-kras, 5 years ago

Attachment: screenshot1.png added

comment:1 by korli, 5 years ago

in InfoWindow.cpp, sizeFormat.Format(result, size); uses the method BMessageFormat::Format(BString& output, const int32 arg). This obviously can't go past 2GB.

I would suggest to add a variable-args Format() method like umsg_vformat() in the ICU C API, using the pattern to guess the parameter types. Maybe wrapping umsg_vformat would be good enough.

comment:2 by axeld, 5 years ago

Owner: changed from axeld to pulkomandy
Status: newassigned

comment:3 by jscipione, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev48859

Note: See TracTickets for help on using tickets.