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
Implement fs::file::get_id() #10904
Conversation
2270f55
to
8b19050
Compare
|
||
FILE_ID_INFO info; | ||
|
||
if (!GetFileInformationByHandleEx(m_handle, FileIdInfo, &info, sizeof(info))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows' implementation is copied from MSVC's STL https://github.com/microsoft/STL/blob/d6f9987d7ec694b8599fe21e87e3653c36566223/stl/src/filesystem.cpp#L419
Why encrypted file view doesn't compare equal to its underlying file in the first place? |
Added fs::file_id::can_a_write_of_another_file_affect_both_files() for clean use for savestates. |
b3ae2c7
to
eb6d632
Compare
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.
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.