- 180 名前:nobodyさん mailto:sage [03/12/03 02:02 ID:???]
- 5.005_03 と 5.8.2 で確認。元より長くなったけど…。
#!/usr/bin/perl use CGI':all';use File::Find;/^\d+$/?$y?$m?($d||=$_):($m=$_-1):($y=$_-1900):/\. txt$/x?($f||=$_):length&&($c.="/$_")for split'/',path_info;find sub{($D,$M,$Y)= (localtime($t=(stat)[9]))[3..5];$e{$File::Find::name}=$t if!($y&&$y-$Y)&&!($m&& $m-$M)&&!($d&&$d-$D)&&(!$f||/^$f$/)&&/\.txt$/},".$c";put header,start_html;for( sort{$e{$b}<=>$e{$a}}keys%e){open F,$_;s|\.||;chomp($h=<F>);put h2(a{href,url. $_},$h),pre<F>,hr}put end_html ・数字は年・月・日としてこの順に拾われ、4つ目以降は無視 ・数字のみのカテゴリ名は許されないが、含む事は可 ・カテゴリは出現順に階層化されているものとして処理する ・".txt" が末尾に付くものはファイルとし、最初に現れたもののみ有効 例 ./7blosxom.cgi ./7blosxom.cgi/2003 ./7blosxom.cgi/2003/11 ./7blosxom.cgi/2003/11/30 ./7blosxom.cgi/foo ./7blosxom.cgi/hoge.txt ./7blosxom.cgi/foo/hoge.txt ./7blosxom.cgi/2003/foo/bar ./7blosxom.cgi/2003/foo/11/bar/30/fuga.txt ./7blosxom.cgi/fuga.txt/2003/////foo1/11////bar2/30
|

|