[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.90, Mon Jul 16 19:44:02 2007 UTC revision 1.91, Mon Aug 20 23:07:05 2007 UTC
# Line 2594  Line 2594 
2594    
2595  =head3 Insure  =head3 Insure
2596    
2597  C<< Insure($dirName); >>  C<< Insure($dirName, $chmod); >>
2598    
2599  Insure a directory is present.  Insure a directory is present.
2600    
# Line 2604  Line 2604 
2604    
2605  Name of the directory to check. If it does not exist, it will be created.  Name of the directory to check. If it does not exist, it will be created.
2606    
2607    =item chmod (optional)
2608    
2609    Security privileges to be given to the directory if it is created.
2610    
2611  =back  =back
2612    
2613  =cut  =cut
2614    
2615  sub Insure {  sub Insure {
2616      my ($dirName) = @_;      my ($dirName, $chmod) = @_;
2617      if (! -d $dirName) {      if (! -d $dirName) {
2618          Trace("Creating $dirName directory.") if T(File => 2);          Trace("Creating $dirName directory.") if T(2);
2619          eval { mkpath $dirName; };          eval {
2620                mkpath $dirName;
2621                # If we have permissions specified, set them here.
2622                if (defined($chmod)) {
2623                    chmod $chmod, $dirName;
2624                }
2625            };
2626          if ($@) {          if ($@) {
2627              Confess("Error creating $dirName: $@");              Confess("Error creating $dirName: $@");
2628          }          }

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.91

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3