Skip to content

Conversation

@THEAccess
Copy link

Fixes #137

This change introduces a fallback mechanism for atomicMove in FileCodec.kt. If atomicMove is unsupported (e.g., on Android 7 and below), it now attempts to copy the temporary file to the destination and then deletes the temporary file. Error handling is included to ensure the temporary file is cleaned up in case of a copy failure.

I don't know if this is the best solution. Comments welcome.

This change introduces a fallback mechanism for `atomicMove` in `FileCodec.kt`. If `atomicMove` is unsupported (e.g., on Android 7 and below), it now attempts to copy the temporary file to the destination and then deletes the temporary file. Error handling is included to ensure the temporary file is cleaned up in case of a copy failure.
@BenjyTec
Copy link

Thanks for the fix - the maintainer needs to approve this merge, correct?

@THEAccess
Copy link
Author

Thanks for the fix - the maintainer needs to approve this merge, correct?

Yes, that is correct

@xxfast
Copy link
Owner

xxfast commented Oct 26, 2025

Hi! Thanks for the PR. Is there a way to branch off to the unsupported mode for unit testing purpose?

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.

Android 7. Crash. UnsupportedOperationException: Atomic move not supported

3 participants