Skip to content

Linux: slurp file bigger than 2GiB reads only part of it #316

@vitstradal

Description

@vitstradal

It looks like slurp does not read whole file.
Reproducer:

$ perl -MPath::Tiny -E '$f = "3G"; path($f)->spew("x"x 3_000_000_000); say -s $f; say length( path($f)->slurp_raw ) '
3000000000
2147479552

Similar observation with slupr_utf8 and slurp.

My machine:

$ lsb_release  -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 25.10
Release:	25.10
Codename:	questing

$ uname -a
Linux zeryk 6.17.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 21:44:46 UTC 2025 x86_64 GNU/Linux

$ uname -m
x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions