Skip to content

Compute File Size is incorrect #11

@alank2

Description

@alank2

Hi,

File size -> It returns -> What it should return
(wrong) 0 bytes -> 1 record -> 0 records
(correct) 1 byte -> 1 record -> 1 record (correct)
(correct) 127 bytes -> 1 record -> 1 record (correct)
(wrong) 128 bytes -> 3 records -> 1 records
(wrong) 129 bytes -> 3 records -> 2 records
(wrong) 255 bytes -> 3 records -> 2 records
(wrong) 256 bytes -> 4 records -> 2 records
(wrong) 257 bytes -> 4 records -> 3 records

I looked at the function and it looks like it adds 1 twice for some reason, but It should only add a 1 a single time and then only if the filesize % RECORD_SIZE is non-zero (% being a modulus operator).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions