Menu

#1188 symlinks in tar archives are extracted to 0 byte files

open
nobody
None
5
2013-06-29
2010-12-15
No

when a tar file contains symlinks then this results in 0 byte files; I think when the file system doesnt suppor symlinks then the symlinks should be resolved to the files they point to, thus when you have an archive like:
./folder_a/original_file
./folder_b/symlink_to_original_file

then a copy of original_file should be extracted to ./folder_b too instead of a 0 byte file.

Discussion

  • Igor Pavlov

    Igor Pavlov - 2010-12-15

    1) Use only latest 7-Zip 9.20.
    2) Show example of such bad "TAR" archive with symlinks.

     
  • No Name

    No Name - 2012-06-01

    I believe this is still a problem. The current solution of 7zip (9.22b and 9.26a) is to create a file and place the destination of the linked file/directory in it. Since this is a tough one to tackle, it would be great if there was an option (especially on the command line 7z) that would force 7-zip to go into a mode that unix links are interpreted as copying the linked file at the location of the link.

    i'll attach a sample .tar file that was compressed on linux, but extracting it on windows produces contents that are not usable.

     
  • Roy Tam

    Roy Tam - 2013-06-29

    sample tar file attached.

    tar tvf shows:

    drwxr-xr-x root/root         0 2013-06-29 11:01:56 a/
    -rw-r--r-- root/root         5 2013-06-29 11:01:53 a/1.txt
    drwxr-xr-x root/root         0 2013-06-29 11:02:11 b/
    lrwxrwxrwx root/root         0 2013-06-29 11:02:11 b/2.txt -> ../a/1.txt
    

    b/2.txt contents becomes "../a/1.txt", but suitable(I can't say "correct" here) action is copying a/1.txt to b/2.txt for extraction.

     

    Last edit: Roy Tam 2013-06-29
  • Roy Tam

    Roy Tam - 2013-06-29

    and hard link sample tar is attached.

    tar tvf shows:

    drwxr-xr-x root/root         0 2013-06-29 11:01:56 a/
    -rw-r--r-- root/root         5 2013-06-29 11:01:53 a/1.txt
    drwxr-xr-x root/root         0 2013-06-29 11:06:17 b/
    hrw-r--r-- root/root         0 2013-06-29 11:01:53 b/2.txt link to a/1.txt
    
     

Log in to post a comment.