Skip to content

fastcdc fails to chunk empty files because of mmap #24

@stoarca

Description

@stoarca

The following throws an error if abs_file is empty (such as a python __init__ file)

    for chunk in fastcdc(abs_file, 2**11, 2**14, 2**15, hf=blake3.blake3, fat=True):

It fails with the following error:

ValueError: cannot mmap an empty file

This worked correctly before mmap was implemented.

My use case is that I need to sync an entire directory to another server and I use fastcdc to reduce the transfer size. I cannot control which files the user adds to the transfer, so sometimes they will be empty files. But the files themselves need to be preserved.

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