The checksum adding step uses a temp file name too#1107
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1107 +/- ##
==========================================
- Coverage 56.39% 56.02% -0.37%
==========================================
Files 100 100
Lines 5050 5053 +3
Branches 2241 2263 +22
==========================================
- Hits 2848 2831 -17
Misses 728 728
- Partials 1474 1494 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kelson42
left a comment
There was a problem hiding this comment.
@veloman-yunkan Please keep older behaviour. keep the old temporary name, don't introduce any new file extension. Just secure that when it is called .zim, then this is a ZIM.
@kelson42 I don't understand why you care so much about the name of the temporary file that in most situations will play no role (but will help to figure out what was wrong if things go wrong).
That's the case with this PR. |
No, everybody writing ZIM file will see that. Uselessly complicated and potentially creating side effects. |
|
Superseeded by #1108 |
Fixes #1106
Now ZIM creation uses a temporary file name during the checksum computation stage too.
Before checksum computation starts the name of the temporary file is REQURESTED_OUTPUT_FILE_NAME.tmp (this file is auto-deleted if an unrecoverable exception is thrown during ZIM writing). This is old behaviour and is mentioned merely for completeness.
During checksum computation the temporary file is renamed to REQURESTED_OUTPUT_FILE_NAME.without_checksum, which is renamed to the final name REQURESTED_OUTPUT_FILE_NAME after the checksum is added (resulting in a valid ZIM file).
If checksum computation fails for whatever reason the *.without_checksum file is preserved and can be converted to a valid ZIM file by a simple script such as below (note that it doesn't rename the input file, which must be done separately):