[Bio] / FigKernelScripts / load_attributes.pl Repository:
ViewVC logotype

View of /FigKernelScripts/load_attributes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Fri Sep 17 18:52:59 2004 UTC (15 years, 6 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +1 -1 lines
load attributes fix

use FIG;
my $fig = new FIG;

my $dbf = $fig->{_dbf};
$dbf->drop_table( tbl => "attribute" );
$dbf->create_table( tbl => 'attribute',
		    flds => "fid varchar(64), tag varchar(64), val text, url text"
		    );
if (opendir(ATTR,"$FIG_Config::global/Attributes"))
{
    my @files = grep { $_ !~ /^\./ } readdir(ATTR);
    closedir(ATTR);

    my $file;
    foreach $file (@files)
    {
	if (-s "$FIG_Config::global/Attributes/$file")
	{
	    $dbf->load_table( tbl => "attribute",
                  file => "$FIG_Config::global/Attributes/$file" );
	}
    }
    $dbf->create_index( idx  => "attribute_fid_ix",
			tbl  => "attribute",
			type => "btree",
			flds => "fid" );
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3