home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
-
- # this script who create a html file name dummy.html when is
- # exercuted. It will link all the readable and non text file
-
- open(FIND, "find . -print |") || die "Couldn't run find: $!\n";
- open (OPENFILE, "> dummy.html");
-
- FILE:
- while ($filename = <FIND>) {
- chop $filename;
- #next FILE if -T $filename; #don't want text file
- next FILE if -d $filename; #don't want sub directory
- next FILE unless -r $filename; #loop again unless readable file
- if (!open(BINFILE, $filename)){
- print STDERR "can't open $filename--continuing...\n";
- next FILE;
- }
- while (<BINFILE>) { #if readable file found
- open(FIZZLE, ">> dummy.html"); #append to file
- print $filename, "\n";
- printf FIZZLE "<img src=\"$filename\">"; #print to file
- printf FIZZLE " <a href=\"$filename\">";
- printf FIZZLE " $filename</a><p> \n";
- next FILE;
- }
- }
-