Skip to content

Fix: Preserve timestamps when decompressing folders #190#422

Open
jalbaali wants to merge 3 commits intoFossifyOrg:mainfrom
jalbaali:issue-190
Open

Fix: Preserve timestamps when decompressing folders #190#422
jalbaali wants to merge 3 commits intoFossifyOrg:mainfrom
jalbaali:issue-190

Conversation

@jalbaali
Copy link
Copy Markdown

@jalbaali jalbaali commented Apr 9, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Added a val foldersTimestamp to create a MutableList of <PairFile,LocalFileHeader> to temporarily store directories and their original data.

  • Updated the block if (entry.isDirectory) to add each directory to the list foldersTimestamp

  • Added a loop after the decompression to rewrite original timestamp on all the folders in reverse order.

Tests

To recreate the bug

  • I created a zip file containing a folder
  • decompressed it
  • the decompressed folder had the wrong timestamp (actual time)

After the fix

  • I created a zip file containing a folder
  • decompressed it
  • the decompressed folder had it's original time

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

@jalbaali jalbaali requested a review from naveensingh as a code owner April 9, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve timestamps when decompressing folders

1 participant