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

Save metadata for extracted file(s) #237

Closed
ikrivosheev opened this issue Dec 30, 2021 · 3 comments · Fixed by #250
Closed

Save metadata for extracted file(s) #237

ikrivosheev opened this issue Dec 30, 2021 · 3 comments · Fixed by #250
Assignees
Labels
enhancement New feature or request high priority

Comments

@ikrivosheev
Copy link

Very often I download the archive of logs from the server. After unpacking, the timestamps of the files are not the same as on the server

@ikrivosheev ikrivosheev added the enhancement New feature or request label Dec 30, 2021
@marcospb19
Copy link
Member

Can you give an reproducible example?

It would be good to see an example where another tool does this correctly and ouch is doing it wrong.

If I understood correctly what you said, there is no way to keep the time stamps.

@ikrivosheev
Copy link
Author

Yes. Simple example.

  1. I have two files:
>> ls -alh ~/projects/opensource/pa-notify/
-rw-r--r--  1 ikrivosheev ikrivosheev  180 Nov 10  2020 .gitignore
-rw-r--r--  1 ikrivosheev ikrivosheev 1.1K Nov 10  2020 LICENSE
  1. Then create archive:
>> ouch c .gitignore LICENSE test.zip
  1. Extract archive:
>> ouch d test.zip
[INFO] ".gitignore" extracted. (180.00 B)
[INFO] "LICENSE" extracted. (1.07 kB)
[INFO] Successfully decompressed archive in current directory.
>> ls -alh .
-rw-r--r--  1 ikrivosheev ikrivosheev  180 Jan 30 14:43 .gitignore
-rw-r--r--  1 ikrivosheev ikrivosheev 1.1K Jan 30 14:43 LICENSE

You can see time of last modification is change.
4. Try to extract with unzip:

>> unzip test.zip
Archive:  test.zip
  inflating: .gitignore
  inflating: LICENSE
>> ls -alh . 
-rw-r--r--  1 ikrivosheev ikrivosheev  180 Jan  1  1980 .gitignore
-rw-r--r--  1 ikrivosheev ikrivosheev 1.1K Jan  1  1980 LICENSE

Work with zip tool:

>> zip test.zip .gitignore LICENSE
adding: LICENSE (deflated 41%)
adding: .gitignore (deflated 33%)
>> mv test.zip /tmp/test/
>> cd /tmp/test
>> unzip test.zip
>> ls -alh
-rw-r--r--  1 ikrivosheev ikrivosheev  180 Nov 10  2020 .gitignore
-rw-r--r--  1 ikrivosheev ikrivosheev 1.1K Nov 10  2020 LICENSE

You can zip save time of last modification for file.

@ikrivosheev
Copy link
Author

ikrivosheev commented Jan 30, 2022

Archive making with zip: zip.zip
Archive making with ouch: ouch.zip

Other archive type have same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants