Return-Path: <hns-users-admin@h14m.org>
Date: Wed, 02 Feb 2000 09:49:05 +0900
From: Yuuki YAMAGATA <yar-3@ops.dti.ne.jp>
Reply-To: hns-users@h14m.org
Subject: [hns-users:00433] time.cgi
To: hns-users@h14m.org
Message-Id: <38977F011AE.1C9EYAR-3@smtp.ops.dti.ne.jp>
X-ML-Name: hns-users
X-Mail-Count: 00433
X-MLServer: fml [fml 3.0pl#22]; post only (only members can post)
X-ML-Info: If you have a question, send e-mail with the body
	"help" (without quotes) to the address hns-users-ctl@h14m.org;
	help=<mailto:hns-users-ctl@h14m.org?body=help>
X-Mailer: Becky! ver 1.25.05
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Precedence: bulk
Lines: 93

$B$*$O$h$&$4$6$$$^$9!#(B
$B$d$"(B3@$B>.>>$G$9!#(B


$BF|5-$N99?7;~9o$rDLCN$9$k(Bcgi$B$r;H$C$F$$$k$N$G(B
$BDs6!$7$^$9!#(B

$B%"%s%F%J$J$I!"99?7;~9o<hF@%(!<%8%'%s%H$K$O(B
$B$3$A$i$N(Buri$B$r%A%'%C%/$7$F$b$i$&$H$$$$$N$G$O$J$$$G$7$g$&$+(B?

http://yar-3.net/d/index.cgi
$B$H(B
http://yar-3.net/d/time.cgi
$B$G!"=jMW;~4V$rHf$Y$F$b$i$($k$H$o$+$k$H;W$$$^$9!#(B


$BNc$K$h$C$FE,Ev$K:n$C$?$N$G!"JQ?t$O%O!<%I%3!<%G%#%s%0!"(B
hnf$B$OJ,;64IM}$rA0Ds$K$7$F$$$^$9!#(B



$B$^$?!"%P%0$J$I8+$D$+$j$^$7$?$i$4;XE&$/$@$5$$!#(B


 time.cgi

#!/usr/bin/perl
# $B99?7;~9oDLCN(Bcgi
# $BJ,;64IM}$rA0Ds$K$7$F$$$^$9(B

use Time::Local;

# *.hnf$B$N$"$k%G%#%l%/%H%j(B
$diarydir = "/home/foo/diary/";
$lastmodified = 0;
$newestfile = "";

($sec, $min, $hour, $mday, $mon, $year,
             $wday, $yday, $isdst) = localtime(time);
$year += 1900;


@a = <$diarydir$year/d*.hnf>;
$year = $year -1;
@b = <$diarydir$year/d*.hnf>;
push(@a, @b);
@b = <$diarydir/d*.hnf>;
push(@a, @b);

sort @a;        # ascii$B=g$KJB$SBX$((B
@a = reverse(@a);       # $B5U=g$K(B

#for ($i = 0; $i < $a ; $i++) {
foreach $i (@a) {
        $t = (stat($i))[9];
        # print "$a[$i] time:$t\n";
        if ($lastmodified < $t) {
                $lastmodified = $t;
                $newestfile = $i;
        }
}

$lm = gmtime($lastmodified);
# Wed Oct  6 21:10:18 1999
# $1  $2  $3 $4       $5
$lm =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/;

print "Content-type: text/html\n";
# DD Cal YYYY hh:mm:ss Zone
# 24 Aug 1999 13:12:01 JST
# RFC$B$K$N$C$H$C$?7A$K(B
$day = $3;
if ($day < 10) {
        $day = "0" . $day;
}

print "Last-modified: $1, $day $2 $5 $4 GMT\n";
print "\n";

print "<html> \n";
print "<head><title>test time.cgi</title></head>\n";
print "<body>\n";
print "Last-modified: $1, $day $2 $5 $4 GMT<br>\n";
print "newest file is $newestfile<p>\n";
print "</body>\n";
print "</html>\n";

1;


-- 
 yar-3 from Komatsu  ore@yar-3.net
 $B$"$k0UL#1J=;(B
