Tar files with long paths mishandled



  • I have been moving java source code form Windows to Linux and back. The path + filename can be as much as 500 bytes or more. I have cheched on the linux specification for tar and pathname lengths of 1000+ bytes are legal.

    When Power Archiver gets a path/ filename that is greater than about 265bytes it generates names that truncate the path and file name to under the local limit for power Archiver.

    It is interesting that the same directory structures are handled correctly when the file is zipped. Under Linux Gzip will correctly decompress the directory structure as well. The hassle is that using Gzip to zip 800Mb into about 400Mb zip file takes about 4 hours against 20 minutes for tar/bzip2.

    The folder structure contains about 22,000 files.


  • conexware

    PA can currently compress correctly TAR path+filename of around 110 characters - although it should be able to uncompress up to maximum under Windows.

    so this is current limitation of PA compress for TAR.

    thanks,



  • It is notable that tar files with long path/filenames from linux are also mishandled. They can be accessed under linux with no problem bu PA also shows trange abbreviations.

    I did a check on Linux Tar specifications and the path file name limit is above 8192 characters.

    Thanks


  • conexware

    @KevinS:

    It is notable that tar files with long path/filenames from linux are also mishandled. They can be accessed under linux with no problem bu PA also shows trange abbreviations.

    I did a check on Linux Tar specifications and the path file name limit is above 8192 characters.

    Thanks

    how do you mean strange abbrevations? Keep in mind that windows file system limit is 256 characters, everything above that will simply not get extracted properly and probably create small havoc in Windows (wont be deletable by Windows Explorer).



  • Keep in mind that windows file system limit is 256 characters

    Actually, if you use the Unicode version of the CreateFile() API, and you prefix the name with “\?” you can get a maximum of something around 32000 characters in a path on Win 2000 or later (ie., not Win9x).

    I know it’s not the most intuitive (and I don’t know if it’s supported by delphi or other components you use), but it’s possible. Also it’s quite possible (as you mention) that the shell might not be able to handle those paths.

    See the MSDN topic “Naming a File” for details: http://msdn.microsoft.com/library/en-us/fileio/fs/naming_a_file.asp


 

5
Online

9.8k
Users

6.0k
Topics

36.8k
Posts