Skip to content

cp --sparse=auto doesn't create a sparse file  #6129

@AnirbanHalder654322

Description

@AnirbanHalder654322

The default coreutils cp behaviour uses standard fs copy as fallback when cow is not available in our filesystem.

Steps to reproduce issue

printf hello > a
./target/release/coreutils cp --sparse=auto a b
du -h b
12K    b
du -h --apparent-size b
11K    b

The correct cp behavior

printf hello > a
/usr/bin/cp --sparse=auto a b
du -h b
4.0K    b
du -h --apparent-size b
11K    b```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions