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

#!/usr/local/bin/perl -w

=head1 NAME

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

=head1 SYNOPSIS

dumpRS.pl output

=head1 DESCRIPTION

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

=head1 AUTHOR

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


=cut


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>