I'm trying to compress a folder into a .7z archive. This folder contains symbolic links to some other stuff outside the folder (both directories and files).
Apparently 7zip just archives the link itself which is not what I intended. Is there a way to tell 7zip that I want it to archive the stuff that it links to, not the link itself? (That is if there is a symlink name foo
which points to C:\stuff\foo
, I want it to include the C:\stuff\foo
directory in the archive in place of foo, not a 0-byte symlink.))
Is there any reasonable workaround apart from adding the files and folders in question? There are about 10,000 files referenced via symlinks so adding them all individually would take hours… Maybe there's a program that creates a staging folder with the real files in it and then passes that to 7zip. Or just an archiver that does handle symlinks better.
I'm running Windows Vista. All the links are symbolic links (eg created with mklink link target
and mklink /D link target
).
EDIT:
dir
command output for a smaller test directory:
C:\...>dir
Volume in drive C is OS
Volume Serial Number is 0A3D-CD6E
Directory of C:\...
09/04/2010 18:12 <DIR> .
09/04/2010 18:12 <DIR> ..
09/04/2010 18:10 975 real file.txt
09/04/2010 18:11 <SYMLINK> test file.txt [..\test file.txt]
2 File(s) 975 bytes
4 Dir(s) 5,214,355,456 bytes free
Creating a 7z archive of that with 7zip results in real file.txt
being included, but test file.txt
is added as a 0 byte file, although the file linked to does exist and is 50KB.