Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: use .tmp file extension while writing a conflated trace in order to indicate that the trace is incomplete if it stays with the .tmp extension #1170

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

powerslider
Copy link
Contributor

No description provided.

// Write the trace at the original and final trace file path, but with the suffix .tmp at the
// end of the file.
final Path tmpTraceFilePath =
tracer.writeToTmpFile(tracesOutputPath, origTraceFileName + ".", TRACE_TEMP_FILE_EXTENSION);
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't we have a '.' too many?

I would have found it easier to follow with final_name = xxx-yyy.lt

and

temp_name = final_name + ".tmp"

Copy link
Contributor Author

@powerslider powerslider Sep 12, 2024

Choose a reason for hiding this comment

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

No, this dot is needed because Files.createTempFile(rootDir, prefix, suffix) appends . at the end and there is no dot symbol before the timestamp so with this approach I am setting the suffix to be .lt.tmp and the renamed file will end with only .lt. Here is a real example from my local testing:

// Temp file name
600-700.conflated.0.6.0-rc1.6783354941660875494.lt.tmp

// Final file name
600-700.conflated.0.6.0-rc1.lt

@powerslider powerslider merged commit 4e2f40a into arith-dev Sep 13, 2024
6 checks passed
@powerslider powerslider deleted the feat/issue-1167/trace-file-tmp-extension branch September 13, 2024 09:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants