Implemented Optimized File Transfer Using Checksums #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the OptimizedFileTransfer class, which provides a mechanism to transfer files between directories while ensuring only modified files are transferred. The implementation relies on SHA-256 hash comparison to detect file changes, thereby optimizing file transfer and reducing redundant operations.
Features
Files are transferred from a source directory to a destination directory only if the content has changed, minimizing unnecessary data transfers.
The system uses SHA-256 to compare the hash values of files in the source and destination directories. If the hashes differ or the file does not exist at the destination, the file is transferred.
The class maintains a list of files that were actually transferred, which can be retrieved using the get_transferred_files method.
Files that are missing or unreadable are handled gracefully, with appropriate messages logged to inform the user of any issues.
Test Cases
Example Workflow
Issue #62