File:  [Local Repository] / db / prgsrc / dumpRS.pl
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Thu Nov 1 01:44:59 2001 UTC (22 years, 5 months ago) by boris
Branches: MAIN
CVS tags: HEAD
added files to makefile. Added use lib "../lib";

#!/usr/bin/perl -w

=head1 NAME

dumpRS.pl - скрипт для создания дампа таблицы word2question.

=head1 SYNOPSIS

dumpRS.pl output

=head1 DESCRIPTION

Создаёт дамп таблицы  word2question. Формат записи:
идентификатор слова (2 байта), длина поля questions (4 байта), 
содержимое поля questions.

=head1 AUTHOR

Роман Семизаров


=cut

    use lib "../lib";
use dbchgk;


my $output=shift;

if (!$output) 
{ 
  print "Usage: dumpRS.pl output\n";
  exit
}

open OUT, ">$output" or die "Can not open $output";
binmode(OUT);
open STDERR, ">errors";
getword2question;

while (($word,$quest)=getrow,$word)
{  
   print "$sch...\n" unless (++$sch%100);
   print OUT pack("L",$word);
   print OUT pack("L", length $quest);
   print OUT $quest;
}



FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>