%# -*-perl-*- $Id: bshow.html,v 1.4 2000/11/12 03:15:11 xi Exp $
<%doc>
###############################################################################
# Usenet Indexer - A nice and fast usenet indexer
# Copyright (C) 2000 Christian Laursen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
###############################################################################
%doc>
%if ($id =~ /^\d+$/) {
<%perl>
my $prefix = sprintf("../data/article/%08x", $id);
open (FILE, "<$prefix.headers") or die "Coulnd't read file: $!";
while () {
$m->out($_);
}
close FILE;
if (open (FILE, "<$prefix.children")) {
my $buffer;
my @children = ();
while (read(FILE, $buffer, 4)) {
push @children, unpack('I', $buffer);
}
close FILE;
$m->out("Children: ".join(',',@children));
}
$m->out("\n");
open (FILE, "<$prefix.body");
while () {
$m->out($_);
}
close FILE;
} else {
$m->out('You evil bastard!');
}
%perl>
<%args>
$id => ''
%args>