I am using the command line version of 7-Zip. It does not appear that there is an option to store full paths in the archive. I would LOVE for this option to be added - it is the only feature that I find lacking.
Any chance of this being added soon?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An option for forcing this behaviour is missing and I agree it would be useful, but until then you can store full paths by writing them. So for example X:\Path\To\File.ext would show up as Path\To\File.ext in the created archive.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Of course it is useful. In fact, this is quite usual feature which, as I recall, existed in arj near twenty years ago. Simple switch paths in filenames.
Since I am doing backup, now and back then, I am tempted to give up this otherwise best archiver. I have hundreds of Gbs of folders/files to backup, and the main problem is identical names around. With paths they wouldn't be.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree, we really need this feature. It doesn't seem like it would be that difficult to implement, either.
I'm not sure what you mean, bjossi… "by writing them"? I have a batch file that creates a 7zip archive and it uses an include list (separate file) with lines like: C:\Path1\Path2\Path3. only "Path3" is put in the 7zip archive.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Remove the c: from the filename and the path _is_ included tho' not of course the device letter. I agree that it would be better if, like zip and other archivers c:\xx\yy.yyy was an acceptable file name, but Igor doesn't seem to want to put this in, or flag c:\xx\yy/zzz as an error, for reasons not known to me.
Also there have been many emails about this so you should look at them before starting a new topic.
Also RTFM!
J
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Removing "C:" is not sufficient. We still need a store full paths option (excluding drive letter of course). I use 7-zip in batch mode referencing an external include list. this file has lines like:
C:\Path1\Path2\Path3
C:\PathA\PathB\PathC
Only "Path3" and "PathC" (and subfolders) are stored in the archive. I want the entire folder structure stored (excluding drive letter). Can't be that difficult to implement this feature!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
maybe I don't get the point, but the guy here complains about that removing "C:\" works…
Just write the top-most folder without drive, but with trailing "\" and give feedback here.
And, if I understand Igor right, the ABSOLUT path (including drive-letter) is denied because of the fact, that this way files can be written in places nobody will find it or to drives that even not exist. But to be honest -> that discussion has taken place *l*o*n*g* time ago…
Best regards!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
re 9, the solution is to make 7zip behave like zip. At present if you put filename as c:\xx\yy\zzz.bbb the path isn't included in archive. This is IMO wrong and is a bug - very confusing eg to those who started this thread. zip puts the path into archive without the c: which is sensible.
J
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ahh… I removed the leading "C:" but not the leading backslash. That made the difference. It produces an archive as I desire when I use this method, but it seems like a lame workaround. We really just need an option to include full paths (except drive letter). That way we don't have to mess around with being in a certain working directory, using relative paths, etc.
Also this workaround isn't doable if my include list needed folders on multiple drives. I guess I'd have to run 7z twice with a different include list for files/folders on each drive, making sure I changed working folders between runs.
Let's just get the appropriate option added to 7-zip and all the complaints will stop! It's obvious numerous people want it!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Fully agreed. The workaround is awkward and requires annoying messing-around that could easily be avoided. All we need is a switch (like -fp) that will force the program to store full paths regardless of the paths used for referencing the files. When -fp in effect, all 7z would do is knowing which files to archive and store their full paths with no questions asked.
Example.
C:
cd Folder1
7z a -fp C:\Archive.7z Folder2\File1.ext D:\Folder3\Folder4\File2.ext
After the operation, we would see Folder1 and Folder3 in the root of the archive, instead of Folder2 and Folder3, thanks to the -fp switch.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
removing "C:\" works… Just write the top-most folder without drive, but with trailing "\"
come on, remembering a switch should be easier than to remember to just skip the leading drive-letter and only specify the top-most folder? If your point should be "well, I can read in help-file which switch to use" => yes, but you can read about skipping X:\ as well. And to say it one more time: removing "C:" isn't sufficient you have to remove the "\" as well => "C:\".
re 9, the solution is to make 7zip behave like zip. At present if you put filename as c:\xx\yy\zzz.bbb the path isn't included in archive. This is IMO wrong and is a bug - very confusing eg to those who started this thread. zip puts the path into archive without the c: which is sensible.
How can it be a bug if the file specified is archived? Confusing maybe. But that's true for the handling of hardlinks as well. Some programs follow the hardlink while archiving, some archive the hardlink itself. So now, what is correct? Both ways are possible, and both have their + as well as their -.
Best regards!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
johnlee1944, you believe the software is fine as-is? Most here believe the workaround is lame and doesn't work in all cases. We vote for a 'store full paths' option. It's the only real solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the "full path" on the command line does not work in all cases. For example, I use an include list (separate file) and all the paths are fully specified in that file (drive letter, path, etc). However, the resulting 7z archive does NOT contain full paths.
We need a separate, true "store full paths" option like other archivers.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ipavlov, that suggestion is insufficient at least when using include lists. (In other words - it does NOT work.)
For example:
7z.exe a archive.7z @filelist.txt
Where filelist.txt includes paths like:
C:\Dir1\Dir1b\Dir1c
C:\Dir2\Dir2b
Will result in a 7z archive that does not show Dir1 or Dir2 level, but rather only Dir1c and Dir2b.
PLEASE include an option for storing full paths. At a minimum it will stop people from complaining. The workaround in the FAQ is hokey (when it works at all).
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the command line version of 7-Zip. It does not appear that there is an option to store full paths in the archive. I would LOVE for this option to be added - it is the only feature that I find lacking.
Any chance of this being added soon?
bump….no one else would think this a useful feature?
An option for forcing this behaviour is missing and I agree it would be useful, but until then you can store full paths by writing them. So for example X:\Path\To\File.ext would show up as Path\To\File.ext in the created archive.
Of course it is useful. In fact, this is quite usual feature which, as I recall, existed in arj near twenty years ago. Simple switch paths in filenames.
Since I am doing backup, now and back then, I am tempted to give up this otherwise best archiver. I have hundreds of Gbs of folders/files to backup, and the main problem is identical names around. With paths they wouldn't be.
I agree, we really need this feature. It doesn't seem like it would be that difficult to implement, either.
I'm not sure what you mean, bjossi… "by writing them"? I have a batch file that creates a 7zip archive and it uses an include list (separate file) with lines like: C:\Path1\Path2\Path3. only "Path3" is put in the 7zip archive.
Mr. Igor Pavlov please, HELP! save our backup, implement full path option in 7z command line as -ep3 option in rar
Remove the c: from the filename and the path _is_ included tho' not of course the device letter. I agree that it would be better if, like zip and other archivers c:\xx\yy.yyy was an acceptable file name, but Igor doesn't seem to want to put this in, or flag c:\xx\yy/zzz as an error, for reasons not known to me.
Also there have been many emails about this so you should look at them before starting a new topic.
Also RTFM!
J
Removing "C:" is not sufficient. We still need a store full paths option (excluding drive letter of course). I use 7-zip in batch mode referencing an external include list. this file has lines like:
C:\Path1\Path2\Path3
C:\PathA\PathB\PathC
Only "Path3" and "PathC" (and subfolders) are stored in the archive. I want the entire folder structure stored (excluding drive letter). Can't be that difficult to implement this feature!
Hello everyone,
maybe I don't get the point, but the guy here complains about that removing "C:\" works…
Just write the top-most folder without drive, but with trailing "\" and give feedback here.
And, if I understand Igor right, the ABSOLUT path (including drive-letter) is denied because of the fact, that this way files can be written in places nobody will find it or to drives that even not exist. But to be honest -> that discussion has taken place *l*o*n*g* time ago…
Best regards!
re message 8, as I said REMOVE C: from the names in the file & the complete filenames will be in the archive…
J
re 9, the solution is to make 7zip behave like zip. At present if you put filename as c:\xx\yy\zzz.bbb the path isn't included in archive. This is IMO wrong and is a bug - very confusing eg to those who started this thread. zip puts the path into archive without the c: which is sensible.
J
Removing C: from my include list made no difference. The resulting 7z archive was identical.
$ type r:\include.lst
Path1\Path2\Path3
PathA\PathB\PathC
$ cd /d c:
$ 7z a d:\archive.7z @r:\include.lst
7-Zip 4.65 Copyright (C) 1999-2009 Igor Pavlov 2009-02-03
Scanning
Creating archive d:\archive.7z
Compressing Path1\Path2\Path3\File3.dat
Compressing PathA\PathB\PathC\FileC.dat
Everything is Ok
$ 7z l d:\archive.7z
7-Zip 4.65 Copyright (C) 1999-2009 Igor Pavlov 2009-02-03
Listing archive: d:\archive.7z
Method = LZMA
Solid = +
Blocks = 1
Physical Size = 19461318
Headers Size = 228
Date Time Attr Size Compressed Name
------------- --- -------- -------- ----------------
2010-06-06 12:22:42 ….A 9775141 19461090 Path1\Path2\Path3\File3.dat
2010-06-06 12:51:44 ….A 9775159 PathA\PathB\PathC\FileC.dat
2010-07-07 18:19:38 D…. 0 0 PathA\PathB\PathC
2010-07-07 18:19:56 D…. 0 0 Path1\Path2\Path3
------------- --- -------- -------- ----------------
19550300 19461090 2 files, 2 folders
$
Ahh… I removed the leading "C:" but not the leading backslash. That made the difference. It produces an archive as I desire when I use this method, but it seems like a lame workaround. We really just need an option to include full paths (except drive letter). That way we don't have to mess around with being in a certain working directory, using relative paths, etc.
Also this workaround isn't doable if my include list needed folders on multiple drives. I guess I'd have to run 7z twice with a different include list for files/folders on each drive, making sure I changed working folders between runs.
Let's just get the appropriate option added to 7-zip and all the complaints will stop! It's obvious numerous people want it!
Fully agreed. The workaround is awkward and requires annoying messing-around that could easily be avoided. All we need is a switch (like -fp) that will force the program to store full paths regardless of the paths used for referencing the files. When -fp in effect, all 7z would do is knowing which files to archive and store their full paths with no questions asked.
Example.
C:
cd Folder1
7z a -fp C:\Archive.7z Folder2\File1.ext D:\Folder3\Folder4\File2.ext
After the operation, we would see Folder1 and Folder3 in the root of the archive, instead of Folder2 and Folder3, thanks to the -fp switch.
Hello everyone,
come on, remembering a switch should be easier than to remember to just skip the leading drive-letter and only specify the top-most folder? If your point should be "well, I can read in help-file which switch to use" => yes, but you can read about skipping X:\ as well. And to say it one more time: removing "C:" isn't sufficient you have to remove the "\" as well => "C:\".
How can it be a bug if the file specified is archived? Confusing maybe. But that's true for the handling of hardlinks as well. Some programs follow the hardlink while archiving, some archive the hardlink itself. So now, what is correct? Both ways are possible, and both have their + as well as their -.
Best regards!
Sorry, under windows i want backup this with full path.
C:\Path1\Path2\Path3\File3.dat
D:\Path1\Path2\Path3\File3.dat
E:\Path1\Path2\Path3\File3.dat
my file, include.lst, contains these strings:
C:\Path1\Path2\Path3\File3.dat
D:\Path1\Path2\Path3\File3.dat
E:\Path1\Path2\Path3\File3.dat
It is possible?
I should change the strings in my include.lst file?
what i should write?…7z a…???
Thank you for yours time
Best regards!
@namelesszero
Not directly possible with 7-Zip. You would need to write a script which mimics the behaviour of the WinRAR -EP3 switch.
Come on guys this is becoming repetitive & stupid - look at other emails in this & other threads + RTFM! J
johnlee1944, you believe the software is fine as-is? Most here believe the workaround is lame and doesn't work in all cases. We vote for a 'store full paths' option. It's the only real solution.
I'm trying to get this to work with "stored paths"
forfiles /P "\Output Archive" /S /M *.* /D -3 /C "cmd /C d:\7za.exe a -mx=9 -tzip d:\archive.zip @path && del @path"
Tried with and without drive letter…
+1 for the 'store full paths' option
Using the "full path" on the command line does not work in all cases. For example, I use an include list (separate file) and all the paths are fully specified in that file (drive letter, path, etc). However, the resulting 7z archive does NOT contain full paths.
We need a separate, true "store full paths" option like other archivers.
Thank you
http://www.7-zip.org/faq.html
ipavlov, that suggestion is insufficient at least when using include lists. (In other words - it does NOT work.)
For example:
7z.exe a archive.7z @filelist.txt
Where filelist.txt includes paths like:
C:\Dir1\Dir1b\Dir1c
C:\Dir2\Dir2b
Will result in a 7z archive that does not show Dir1 or Dir2 level, but rather only Dir1c and Dir2b.
PLEASE include an option for storing full paths. At a minimum it will stop people from complaining. The workaround in the FAQ is hokey (when it works at all).
Thank you
Suggestion from FAQ works.
Check it again.