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

Bug (archive creation fails when two files with the same filename but different path are passed prepended with "./" as filename arguments in linux) #55

Open
Ashbd9 opened this issue Sep 16, 2024 · 2 comments

Comments

@Ashbd9
Copy link

Ashbd9 commented Sep 16, 2024

System: Linux
7z version: 24.08

How to reproduce:

  1. touch file
  2. mkdir subdir
  3. touch subdir/file
  4. 7zz a .7z ./file ./subdir/file

Current Behaviour:
ERROR:
Duplicate filename on disk:
file
file

Expected Behaviour:
The archive .7z is created and contains file subdir/file.
By the way, it works if the filename arguments are passed without the starting "./" i.e. as
7zz a .7z file subdir/file
It does not work when it is 7zz a .7z ./file ./subdir/file
Also does not work is 7zz a .7z /tmp/file /tmp/subdir/file

@ip7z
Copy link
Owner

ip7z commented Sep 16, 2024

It's feature.
7-zip removes path prefixes for absolute paths and for paths starting from ./.
7-zip doesn't remove path prefixes for relative paths without ./ prefix.

So if you want path prefixes in archive, do not use ./.
If you don't want path prefixes in archive, use ./ or absolute paths.

@Ashbd9
Copy link
Author

Ashbd9 commented Sep 17, 2024

I have been reading the documentation and found that I can use the -spf flag to make it work in my case.
Thank you!

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

No branches or pull requests

2 participants