Archived Forum Post

Index of archived forum posts

Question:

ChilkatDotNet - file path length limit in USTAR

Oct 21 '13 at 12:32

Hello Chilkat,

We use ChilKat.Net Tar to generate "ustar" Tar files in our application. Recently I came across a strange problem with long file names / paths. The longest file paths of this dataset is 186 characters, which based on ustar specification (100+155) should be OK.

The annoying thing is, however, that I get no exception or LastErrorText whatsoever. It just halts the application in the middle of the air. FYI : I use the tar component in a BackgroundWorker and report the progress using the OnNextTarFile event.

Could you please let me know :

Thank you very much in advance for your assistance.

Best Regards,

Yashar Moradi

Disy Informationssysteme GmbH


Answer

Long paths should be OK. Make sure that the progress callbacks are not causing the problem. Do this by removing the callback events. Does the same problem occur?

My advice would be to reproduce the problem in a very simple example that does not use background worker threads or event callbacks. If the problem can be reproduced in this way, then please provide a code snippet and sample data that can be used to reproduce the problem.


Answer

Hi,

Thank you for the prompt respond. I tried to run the same process without the complications of background thread, but still the problem occurs. The WriteTar process hangs the whole application and never returns control to the main code. Although when I try the same Folder, only with a shorter name with the same code, the WriteTar takes less than a second to run.

Here is my simplified code for this task. I would appreciate any assistance in this regard, because it has became a blocker for our application.

        Chilkat.Tar tar = new Chilkat.Tar();
        tar = new Chilkat.Tar();
        tar.WriteFormat = "ustar";
        bool success;
        success = tar.UnlockComponent(ChilkatUtilities.CHILKAT_TAR_LICENSE);
        if (success != true)
        {
            log.Error(tar.LastErrorText);
        }

        string directory = "someDirectoryPath\\~cmTmp130217323277860862";

        if (!Directory.Exists(directory))
            throw (
                new Exception(
                    string.Format(
                    Properties.Resources.ERR_FOLDER_NOT_EXIST,
                    directory)));

        string TargetFilename = "C:\\temp\\testChilkatTar.cmmap";
        if (File.Exists(TargetFilename))
            File.Delete(TargetFilename);

        success = tar.AddDirRoot(directory);
        if (success != true)
        {
            log.Error(tar.LastErrorText);
        }

        success = tar.WriteTar(TargetFilename);

The longest path passed to the function is something like this:

C:\Users\moradiafkan\Documents\GIS 2go Maps\~cmTmp130217323277860862\layers\ortho-fotos_des_landes_vorarlberg\.tiles\1.0.0\ortho-fotos_des_landes_vorarlberg\default\generated\s1\2\1.jpg

I thank you in advance,

Best regards,

Yashar Moradi

Disy Informationssysteme GmbH


Answer

Yashar,

Make sure you're using the very latest version of Chilkat (v9.4.1). Turn on verbose logging by setting the tar.VerboseLogging property = true. Then set the tar.DebugLogFilePath property equal to the path of a log file that will be created. Run your program to get the hang. Then send the log file to support@chilkatsoft.com.


Answer

You can try "Long Path Tool" program.