[Bio] / FigKernelScripts / p3x-setup-alignment-sync-dir.pl Repository:
ViewVC logotype

View of /FigKernelScripts/p3x-setup-alignment-sync-dir.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Jun 29 15:53:10 2018 UTC (16 months, 2 weeks ago) by olson
Branch: MAIN
CVS Tags: HEAD
For P3 fam build, set up sync.dir

use strict;
use Getopt::Long::Descriptive;

my($opt, $usage) = describe_options("%c %o genus-data-dir sync-dir",
				    ["help|h" => "show this help message"]);
print($usage->text), exit 0 if $opt->help;
die($usage->text) unless @ARGV == 2;

my $genus_data = shift;
my $sync_dir = shift;

die "Sync dir $sync_dir already exists" if -e $sync_dir;

opendir(D, $genus_data) or die "Cannot opendir $genus_data: $!";

mkdir($sync_dir) or die "Cannot mkdir $sync_dir: $!";

while (my $p = readdir(D))
{
    next if $p =~ /^\./;
    my $path = "$genus_data/$p";

    if (-d $path)
    {
	if (! -f "$path/families.all")
	{
	    die "$path does not have a families.all\n";
	}
	open(F, ">", "$sync_dir/$p") or die "Cannot write $sync_dir/$p: $!";
	close(F);
    }
}
closedir(D);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3