Skip to content

Change the copy_to_file method #306

@Kerollmops

Description

@Kerollmops

Currently, the Env::copy_to_file doesn't take a file as an argument but a path, and the Env::copy_to_fd is too raw. Therefore, it is not easy to use the Env::copy_to_file along with the tempfile crate.

I want to propose a new API for the Env::copy_to_file method that takes a &File as argument:

pub fn copy_to_file(&self, file: &mut File, option: CompactionOption) -> Result<()>;

However, I noticed and forgot that the cursor position of the file descriptor is not resetting correctly. It seems that the file must be closed and reopened, which is an issue. The proposed API could not be released if this issue is still present. I need to investigate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingA change that is breaking the semverenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions