Skip to content

Add tests about the clone function #1

@RexSkz

Description

@RexSkz

I just found a tool that can tell whether two files share the same physical blocks: https://github.com/dyorgio/apfs-clone-checker

$ gcc clone_checker.c -o clone_checker

$ chmod +x clone_checker

$ ls
LICENSE
README.md
clone_checker
clone_checker.c

# normal copy
$ cp README.md README.copy.md

# use copyfile
$ cp -c README.md README.clone.md

$ ./clone_checker README.md README.copy.md
0

$ ./clone_checker README.md README.clone.md
1

# make some changes
$ vi README.clone.md

$ ./clone_checker README.md README.clone.md
0

It could be used to test the clone function.

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