> 2000/03/29 (水) 04:55:48 ▼ ◇ [mirai]> > SSIで呼ぶんだよね?
> そうです
#!/usr/local/bin/perl
$BASE = "ssic";
$BLOCK = 1024;
$CFILE = "$BASE.ct";
$BFILE = "$BASE.bt";
open(COUNT, ">>$CFILE") || &error(1, "Cannot open $CFILE");
print COUNT "a";
close(COUNT);
if($BLOCK <= (-s $CFILE))
{
open(BLOCK, ">>$BFILE") || &error(1, "Cannot open $BFILE");
print BLOCK "a";
close(BLOCK);
open(COUNT, ">$CFILE") || &error(1, "Cannot open $CFILE");
close(COUNT);
}
$count = (((-s $BFILE) || 0) * $BLOCK) + (-s $CFILE);
print "Content-type: text/plain\n\n";
printf "%d", $count;
exit;
sub error
{
$exit = shift(@_);
print "Content-type: text/plain\n\n";
print "@_";
exit if($exit);
}
とりあえずファイル名固定ヽ(´ー`)ノ
$BASEに指定した文字列に.btと.ctって言う拡張子を付けた
空のファイルを書きこめるパーミッションで一緒に置く。
ちなみに
http://kiroro2000.virtualave.net/dual/dual.html
で使うために適当に書いた飛ばないカウソタヽ(´ー`)ノ
参考:2000/03/29(水)04時52分30秒