30 years? I can keep up with that.Horst.Epp wrote:Ok, there is a problem with -spf option.tc4e wrote:Tcmd's built-in 7zip shows "dir" twice which is partially ok.tc4e wrote: Example:
c:\dir\file has content "content 1"; d:\dir\file has content "content 2"
7z a -spf archive.7z c:\dir\file d:\dir\file
It should also show the drive letter.
Under each "dir" "file" is shown twice due to the ignored drive letter of path "dir".
One "file" then is shown with "content 1", the other "file" with "content 2" which is correct so far.
But for what reason should I ever store the absulute pathnames in an archive ?
Never needed this for the last 30 years of working with archives
on all sort of Windows machines.
But back to arguments.
For a good reason and on many requests Igor Pavlov implemented the
-spf option.
When archiving files in windows systems with one drive only
there is really no need using -spf.
Other than with two and more drives, identical paths, and one archive only.
In a broader sense drive letters in windows systems can be treated as mount points in *nix systems.
No one would request there to create distinct archives when files from more than one file system respectively "top directory" should be archived.
This behavior, by the way, is default with zip (http://www.info-zip.org) for a very long time.
You have to specify the -j option there to drop the path.
Anyway, the reason for using 7zip's -spf is shown in the example below
with -spf dropped:
7z a archive.7z c:\dir\file d:\dir\file
7-Zip [64] 15.12 : Copyright (c) 1999-2015 Igor Pavlov : 2015-11-19
Scanning the drive:
2 files, 20 bytes (1 KiB)
Creating archive: archive.7z
ERROR:
Duplicate filename on disk:
file
file