Hello Monks,
I am attempting to create a directory from UNIX using a SAMBA mount to windows box. I have a parent script which calls a child script, the parent script creates the directory just fine.
However the second script which is a child process, does the exact same thing however when passed in it is given a new name for the directory that is to be created. Oddly enough it did not create the directory nor did it die. It appears is if perl thinks everything worked fine.
Has anyone experienced this before? Any help would be wonderful
Please find the code below.
Script 1
<code>
use strict;
use File::Path;
my $dirStr = '/Path/To/Directory/Dir1';
unless (-d $dirStr){
mkpath ($dirStr, 1, 0777) or die("Directory $dirStr does not exist and cannont be created");
print "Makeing First Dir from Parent Script\n";
my $command = "perl /usr/local/users/myuser/createdir2.pl";
open(TEST, "|$command");
}
<code>
Script 2 "createdir2.pl"
<code>
use strict;
use File::Path;
my $dirStr1 = '/Path/To/New/Directory/Dir2';
unless (-d $dirStr1){
mkpath ($dirStr1, 1, 0777) or die("Directory $dirStr1 does not exist and cannont be created");
print "Makeing Second Dir from Child Process\n";
}
<code>
Thanks in advance

In reply to Child Process and SAMBA by mricci

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.