Archived Forum Post

Index of archived forum posts

Question:

How to include path infomation with multiplke calls to AddDirRoot

Jan 14 '16 at 11:17

Following on from http://www.chilkatforum.com/questions/1487/dirprefix-how-do-you-use-this.

How do you include path information when calling AddDirRoot() multiple times? put_DirPrefix will work with across the entire tar, so it's not useful with multiple directories.

For example:

If I do a simple shell command:

tar -cf tmp/nmsconfig.tar etc/check_mk var/check_mk/precompiled/ var/check_mk/autochecks

tar -tf tmp/nmsconfig.tar returns (abbreviated for example)

etc/check_mk/
etc/check_mk/main.mk
etc/check_mk/mkeventd.mk
etc/check_mk/multisite.mk
var/check_mk/precompiled/
var/check_mk/precompiled/NMS_Dummy.py
var/check_mk/precompiled/nms_true_test150
var/check_mk/precompiled/nms
var/check_mk/autochecks/
var/check_mk/autochecks/nms_true_test150.mk
var/check_mk/autochecks/nms_true_test2.mk
var/check_mk/autochecks/nms.mk

However if I build the tar using chilkat, like this (error checking removed for brevity):

dirPath = _sitePath + "/etc/check_mk";
tar.AddDirRoot(dirPath.c_str());
dirPath = _sitePath + "/var/check_mk/precompiled";
tar.AddDirRoot(dirPath.c_str());
dirPath = _sitePath + "/var/check_mk/autochecks";
tar.AddDirRoot(dirPath.c_str());
//  write the tar
dirPath = _sitePath + "/tmp/nmsconfig.tar";
tar.WriteTar(dirPath.c_str());

a call to tar -tf tmp/nmsconfig.tar returns

main.mk
mkeventd.mk
multisite.mk
NMS_Dummy.py
nms
nms_true_test
nms_true_test.py
nms_true_test.mk
nms.mk

So it's missing all the path information and basically makes it unusable at the server end.

A call to put_DirPrefix() will just prepend the directory to all the contents of the tar, so I still can't tell which file cam from what path.

Is there any way you can add an option to AddDirRoot to include the path information when building the tar?

Thanks


Answer

I added an AddDirRoot2 method. Please let me know what programming language/operating system (.NET version, Visual Studio version, Perl/Python/etc. version) that you need so I can provide a specific pre-release build..

See the online reference documentation for the update..


Answer

Thanks for the prompt reply.

C++ linux for now would be great (libchilkat.so). .Net C# for future would be nice.


Answer

64-bit pls. When do you think the new release will be available?


Answer

Here's the new build: http://www.chilkatsoft.com/download/preRelease/chilkat-9.5.0-x86_64-linux-gcc.tar.gz