File:  [Local Repository] / db / prgsrc / dumpRS.pl
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Wed Oct 31 03:00:10 2001 UTC (22 years, 6 months ago) by boris
Branches: MAIN
CVS tags: HEAD
Adding Roma 7's files

    1: #!/usr/local/bin/perl -w
    2: 
    3: =head1 NAME
    4: 
    5: dumpRS.pl - скрипт для создания дампа таблицы word2question.
    6: 
    7: =head1 SYNOPSIS
    8: 
    9: dumpRS.pl output
   10: 
   11: =head1 DESCRIPTION
   12: 
   13: Создаёт дамп таблицы  word2question. Формат записи:
   14: идентификатор слова (2 байта), длина поля questions (4 байта), 
   15: содержимое поля questions.
   16: 
   17: =head1 AUTHOR
   18: 
   19: Роман Семизаров
   20: 
   21: 
   22: =cut
   23: 
   24: 
   25: use dbchgk;
   26: 
   27: 
   28: my $output=shift;
   29: 
   30: if (!$output) 
   31: { 
   32:   print "Usage: dumpRS.pl output\n";
   33:   exit
   34: }
   35: 
   36: open OUT, ">$output" or die "Can not open $output";
   37: binmode(OUT);
   38: open STDERR, ">errors";
   39: getword2question;
   40: 
   41: while (($word,$quest)=getrow,$word)
   42: {  
   43:    print "$sch...\n" unless (++$sch%100);
   44:    print OUT pack("L",$word);
   45:    print OUT pack("L", length $quest);
   46:    print OUT $quest;
   47: }
   48: 
   49: 

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