Skip to content
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

Implement fs::file::get_id() #10904

Merged
merged 2 commits into from Jul 17, 2023
Merged

Implement fs::file::get_id() #10904

merged 2 commits into from Jul 17, 2023

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Sep 21, 2021

Mimicking std::filesystem::equivalent() when comparing two file IDs, also adds readable information about the types of the overriding classes.
This feature is needed for savestates.

@elad335 elad335 marked this pull request as draft September 21, 2021 13:39
@elad335 elad335 force-pushed the file-id branch 2 times, most recently from 2270f55 to 8b19050 Compare September 21, 2021 14:13
@elad335 elad335 marked this pull request as ready for review September 21, 2021 14:13

FILE_ID_INFO info;

if (!GetFileInformationByHandleEx(m_handle, FileIdInfo, &info, sizeof(info)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elad335 elad335 mentioned this pull request Sep 21, 2021
9 tasks
@Nekotekina
Copy link
Member

Why encrypted file view doesn't compare equal to its underlying file in the first place?

@elad335
Copy link
Contributor Author

elad335 commented Sep 23, 2021

Added fs::file_id::can_a_write_of_another_file_affect_both_files() for clean use for savestates.

File descripor ID with 2 provided ways to compare between them:
1. is_mirror_of():
 Test if identical:
  For example: when LHS writes one byte to a file at X offset, RHS file be able to read that exact byte at X offset)

2. is_coherent_with():
 Test if both files point to the same file:
  For example: if a file descriptor pointing to the complete file exists and is being truncated to 0 bytes from non-
  -zero size state: this has to affect both RHS and LHS files.
@elad335 elad335 merged commit 41d3897 into RPCS3:master Jul 17, 2023
5 checks passed
@elad335 elad335 added the Bugfix label Jul 17, 2023
@elad335 elad335 deleted the file-id branch May 6, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants