4 # $Id: getstamps.pl,v 1.3 2007-08-19 13:46:54 welle Exp $
7 # Author: Michael Welle
9 # This file is available under the terms of the GNU General Public
12 # Modified by Michael Olson to add Author note. license text, and to
13 # fix a use of "muse" rather than $muse_file_extension.
15 #my $tsfile = "/tmp/blog/timestamps";
17 my $muse_file_extension = "muse";
30 if ( /^#date\s+(.+)$/ ) {
35 $file =~ s/\.${muse_file_extension}$/\.txt/;
38 if ( $d =~ /(\d\d\d\d)-(\d\d)-(\d\d)-(\d\d)-(\d\d)/ ) {
40 printf TS
"${file}=>$2/$3/$1 $4:$5\n";
58 sub traverse_directory
{
65 opendir( DIR
, $directory );
66 @files = readdir( DIR
);
70 foreach my $file ( @files ) {
72 next if ( !( $file =~ /^.*\.${muse_file_extension}$/ )
73 || ($file eq '.') || ($file eq '..'));
76 $path = "$directory/$file";
80 traverse_directory
( $path );
84 process_file
( $path );
90 } # traverse_directory
97 open( TS
, ">${tsfile}" );
101 traverse_directory
( "." );
105 traverse_directory
( $ARGV[0] );