<lots of rude words of frustration!> It's NOT working. The example I had working was doing it running standalone but the production version has to run as a task called under another app. The code below never gets away from the application's run time directory even though they're both branches under the same root.
$vsvroot = $config{$ServerX . "ROOT"}; chdir($vsvroot); MsgLog ("d", "vsvroot = $vsvroot"); MsgLog ("d", cwd()); foreach $vsvxdb (<cntl/*>) { MsgLog ("d", "Add $vsvxdb to tarfile\n"); if (! $tar->add_files($vsvxdb)) { MsgLog ("e", "Failed to add original $vsvxdb to backup + archive. Quitting.") } }
The log shows...

vsvroot = "C:\LRSROOT\vsvxroot"

C:/LRSROOT/vpsxroot

Add cntl/ckpt.dat to tarfile

Which lines above correspond to the three MsgLog function calls in the sample code. Note that the vsvroot variable (I left the $ off in the log message) uses backslashes and points to the vsVxroot folder but the print of cwd() shows the vPsxroot folder - same parent, different subfolders. The perl code is called from and app who's root is vPsxroot. I've tried this with a simple test script and it definitely still calls tar from the working directory which is not changed by chdir(). I'm very confused!


In reply to Re^5: Archive::Tar from somewhere outside my runtime directory by Anonymous Monk
in thread Archive::Tar from somewhere outside my runtime directory by murrayn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.