Skip to content

Fix issue #232: Handle size mismatch after file copy#291

Open
CatalinaLeca wants to merge 2 commits into
xoriors:mainfrom
CatalinaLeca:fix-copy-file-bug
Open

Fix issue #232: Handle size mismatch after file copy#291
CatalinaLeca wants to merge 2 commits into
xoriors:mainfrom
CatalinaLeca:fix-copy-file-bug

Conversation

@CatalinaLeca
Copy link
Copy Markdown

Title

If this is related to a GitHub issue, please have use the issue's title, inlcude #ID too.

Description

Please include a summary of the changes and the related issue. Describe why this change is needed.

Fixes # (issue)


Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • I have performed a self-review of my code
  • I have tested my code on different platforms (if applicable)
  • I have commented my code, particularly in hard-to-understand areas
  • I have added necessary documentation (if appropriate)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

Add screenshots to illustrate changes if necessary.


Additional Context

Add any additional context or information here.

Copilot AI review requested due to automatic review settings April 26, 2025 10:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses issue #232 by refining the write method to correctly handle size mismatches after file copy operations.

  • Introduces a mutable offset and uses a looping mechanism to continue writing in chunks until the entire buffer is processed.
  • Implements improved file handle validation and aggregates the total bytes written to update file attributes accordingly.
Comments suppressed due to low confidence (1)

src/encryptedfs.rs:1681

  • The variable 'write_guard' is undefined. It should be replaced with the existing 'guard' variable or removed if not needed.
drop(write_guard);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants