-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more advanced API #80
Comments
Thanks! I think For For |
I can assist with Windows implementation. The key aspect here is to check if |
That'd be great! I'm willing to do the review on any PR send in for this. For the for |
First of all, thank you for maintaining this useful crate!
I would like to propose a few new additions to the API that I believe would benefit crate's users.
Return the operation used in
reflink_or_copy
reflink_or_copy should return an enum indicating the operation performed:
enum OperationResult { Cloned, Copied }
This provides clearer feedback to the caller about the action taken. It can be useful for understanding the efficiency of cloning, space consumption, etc.
Add more functions:
fn is_reflink_supported(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<SupportedStatus>
enum SupportedStatus { Supported, NotSupported, Unknown }
This function would help to avoid unnecessary API calls if reflink is not supported, especially when copying large folders. It would also prevent unnecessary copying if cloning is expected to work. For example, blockcloning is not supported between different ReFS volumes, so it would be quite inefficient to use this function for copying a large directory.
fn reflink_block(file1: FileHandle, offset1: u64, size: u64, file2: FileHandle, offset2: u64) -> Result<()>
Adding block-level reflink capabilities allows for more granular and efficient data management. This can be particularly beneficial for applications that need to clone or deduplicate specific segments of large files.
The text was updated successfully, but these errors were encountered: