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

Wrong tar extraction #4513

Open
mc-butler opened this issue Nov 21, 2023 · 1 comment
Open

Wrong tar extraction #4513

mc-butler opened this issue Nov 21, 2023 · 1 comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4513
Reporter fraganestis (anestis@….eu)

You can add (using tar -r) in a tar file multiple files with the same name (or multiple versions of the same file).
When such tar file is opened in mc, every 'instance' of these entries (or occurrences as the tar help refers to them) is listed.
But when you copy or view such an occurrence, no matter which one you select, always the same file is displayed/copied.

Steps to reproduce:
1) create a file named sample1.txt with the following contents

Text line v1

2) execute

tar -rf test.tar sample1.txt

3) modify the sample1.txt to have the following contents

Text line v2

4) execute

tar -rf test.tar sample1.txt

5) open the test.tar using mc

6) view(F3) or copy (F5) each file.
The files will be identical

Expected behavior:
The newer file should reflect the modified state of the sample1.txt while the old should reflect the initial.

To correctly view the 'instances' of the file using tar, you can run

tar -xf test.tar sample1.txt -O --occurrence=1

for the initial version

tar -xf test.tar sample1.txt -O --occurrence=2

for the new version

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 21, 2023 at 19:37 UTC (comment 1)

  • Component changed from mc-core to mc-vfs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant