in reply to Problem with Archive::Tar created archives and Winzip

Hi smahesh,

I think the following, found in the FAQ section of the Archive::Tar documentation, is relevant here:
I'm using WinZip, or some other non-POSIX client, and files are not being extracted properly! By default, "Archive::Tar" is in a completely POSIX-compatible mo +de, which uses the POSIX-specification of "tar" to store files. For paths greather than 100 characters, this is done using the "POSIX header prefix". Non-POSIX-compatible clients may not support this part of the specification, and may only support the "GNU Extended Header" functionality. To facilitate those clients, you can set t +he $Archive::Tar::DO_NOT_USE_PREFIX variable to "true". See the "GLO +BAL VARIABLES" section for details on this variable.
Did you try setting the $Archive::Tar::DO_NOT_USE_PREFIX variable to "true" ? Admittedly the FAQ seems to be describing a slightly different issue, but (IIRC) setting  $Archive::Tar::DO_NOT_USE_PREFIX variable to "true" does fix that "flattening" issue you describe.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Problem with Archive::Tar created archives and Winzip
by smahesh (Pilgrim) on Jul 20, 2007 at 10:38 UTC

    Hi syphilis++,

    I tried your suggestion and it works. With the modification, Winzip correctly reports the full paths.

    Now, I am investigating a way of getting relative paths. In my example, I am tarring 'C:\Temp\data' directory. I want only paths under 'data' directory to be displayed - i.e paths relative to the $srcDir attribute.

    Mahesh