Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

How to include path infomation with multiplke calls to AddDirRoot

$
0
0

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


Viewing all articles
Browse latest Browse all 1061

Trending Articles