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

Remove the usage of 7z "-r" flag #21

Closed
rapiz1 opened this issue Jan 6, 2022 · 1 comment · Fixed by #22
Closed

Remove the usage of 7z "-r" flag #21

rapiz1 opened this issue Jan 6, 2022 · 1 comment · Fixed by #22

Comments

@rapiz1
Copy link
Contributor

rapiz1 commented Jan 6, 2022

From 7z manpages

-r[-|0]
Recurse subdirectories (CAUTION: this flag does not do what you think, avoid using it)

Do not use "-r" because this flag does not do what you think.

https://itectec.com/superuser/7z-what-does-the-r-flag-do/

This doesn't fit most people's expectation. And simply removing it will do.

@rapiz1
Copy link
Contributor Author

rapiz1 commented Jan 6, 2022

A little explanation here:

$ tree
.
├── bar
│   └── foo
└── foo
$ 7z a -tzip expect.zip foo
$ 7z a -r -tzip actual.zip foo
$ 7z l expect.zip
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs x64)

Scanning the drive for archives:
1 file, 140 bytes (1 KiB)

Listing archive: expect.zip

--
Path = expect.zip
Type = zip
Physical Size = 140

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2022-01-06 16:21:55 .....            0            0  foo
------------------- ----- ------------ ------------  ------------------------
2022-01-06 16:21:55                  0            0  1 files

$  7z l actual.zip
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs x64)

Scanning the drive for archives:
1 file, 266 bytes (1 KiB)

Listing archive: actual.zip

--
Path = actual.zip
Type = zip
Physical Size = 266

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2022-01-06 16:21:58 .....            0            0  bar/foo
2022-01-06 16:21:55 .....            0            0  foo
------------------- ----- ------------ ------------  ------------------------
2022-01-06 16:21:58                  0            0  2 files

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 a pull request may close this issue.

1 participant