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

Qt: Fix saved log filename #14239

Merged
merged 3 commits into from Jul 21, 2023
Merged

Qt: Fix saved log filename #14239

merged 3 commits into from Jul 21, 2023

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Jul 21, 2023

  • Allow non-english letters.
  • Fix missing ']'.
  • Deduplicate spaces.
  • Show log directory on success to further simplify log finding.

@elad335 elad335 force-pushed the llvm-link branch 2 times, most recently from 38a2a32 to 8666b63 Compare July 21, 2023 08:30
@@ -2413,6 +2413,12 @@ void main_window::CreateConnects()
// Try to copy it if fails
if (fs::copy_file(from, to, true))
{
if (fs::file sync_fd{to, fs::write})
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a param of copy_file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for the move operation not the copy, it's outside the scope of copy_file. It may be added for rename in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't make any sense

Copy link
Contributor Author

@elad335 elad335 Jul 21, 2023

Choose a reason for hiding this comment

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

Remove file operation may be ordered before file write. On powerloss, this can result in a loss of log file data.

Copy link
Contributor

Choose a reason for hiding this comment

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

This still doesn't explain why you didn't make it an option for copy_file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because syncronizing disk file writes is an expensive operation and has very specific use cases. It's better for it not to be in fs::copy_file nor in fs::file::write to avoid misuse.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's literally the only reason why you would sync.
And that still doesn't explain why it's not a parameter

Copy link
Contributor Author

@elad335 elad335 Jul 21, 2023

Choose a reason for hiding this comment

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

It should be used with caution due to the performance panelty, a programmer can easily use it without giving it too much thought which can be detrimental. Boolean parameter can easily slip in review because it is very subtle. Yes we can add a specially typed constant for it to be very explicit such as file.write(buffer, fs::syncronize_this_write_to_disk) but it seems to be overkill.

@elad335 elad335 merged commit 38a5313 into RPCS3:master Jul 21, 2023
5 checks passed
@elad335 elad335 deleted the llvm-link branch July 21, 2023 11:10
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

2 participants