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

Diff of /FigKernelPackages/SeedUtils.pm

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

revision 1.7, Mon Aug 31 22:07:19 2009 UTC revision 1.8, Wed Sep 2 20:28:21 2009 UTC
# Line 23  Line 23 
23      use Tracer;      use Tracer;
24      use base qw(Exporter);      use base qw(Exporter);
25    
26      our @EXPORT = qw(create_fasta_record rev_comp genome_of min max sims);      our @EXPORT = qw(create_fasta_record rev_comp genome_of min max sims verify_dir);
27    
28  =head1 SEED Utility Methods  =head1 SEED Utility Methods
29    
# Line 449  Line 449 
449      return @retVal;      return @retVal;
450  }  }
451    
452    =head3 verify_dir
453    
454        verify_dir($dirName);
455    
456    Insure that the specified directory exists. If the directory does not
457    exist, it will be created.
458    
459    =over 4
460    
461    =item dirName
462    
463    Name of the relevant directory.
464    
465    =back
466    
467    =cut
468    
469    sub verify_dir {
470        # Get the parameters.
471        my ($dirName) = @_;
472        # Strip off the final slash, if any.
473        $dirName =~ s#/$##;
474        # Only proceed if the directory does NOT already exist.
475        if (! -d $dirName) {
476            # If there is a parent directory, recursively insure it is there.
477            if ($dirName =~ m#(.+)/[^/]+$#) {
478                verify_dir($1);
479            }
480            # Create this particular directory with full permissions.
481            mkdir $dirName, 0777;
482        }
483    }
484    
485    
486  1;  1;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3