login about faq

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

asked Jan 11 at 19:15

phoman's gravatar image

phoman
1


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..

link

answered Jan 11 at 19:51

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for the prompt reply.

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

link

answered Jan 12 at 02:06

phoman's gravatar image

phoman
1

64-bit or 32-bit?

(Jan 12 at 10:53) chilkat ♦♦

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

link

answered Jan 13 at 15:41

phoman's gravatar image

phoman
1

link

answered Jan 14 at 11:17

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×17

Asked: Jan 11 at 19:15

Seen: 495 times

Last updated: Jan 14 at 11:17

powered by OSQA