Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../server/etc/scripts/gen-index/create_icons
Real path: /www/server/etc/scripts/gen-index/create_icons
Zurück
#!/usr/bin/perl # # @(#)create_iconslist.pl 1.0 30.05.94 ftpsoft # # Usage: # create_namelist [filename|-] [filename...] # If filename is not specified, use index.html for input # If filename is "-", use stdin # If filename is specified, use filename for input # Multiple filenames may be specified, they will be read sequentially %FILE = ( '/icons', 'icons.neu', '/images', 'images.neu'); %ICONDIR = ( '/icons', '/www/server/data/icons', '/images', '/www/server/data/bitmaps'); %HEADER = ( 'xbm', 'X - Bitmaps', 'xpm', 'X - Pixmaps', 'gifbutton', 'GIF - Buttons', 'gif', 'Weitere GIF - Bilder', 'other', 'Andere Formate'); $date = `date +'%d-%m-%y (%T)'`; chop($date); $postindex = `sed -e 's/DATE/$date/' .postindex`; $preindex = `cat .preindexicons`; foreach $dir ( '/icons', '/images' ) { &readicons(); &writefile(); } exit (0); sub readicons { foreach $group ( keys( %HEADER )) { eval ("\@$group = ();"); } open ( ICONS, "cd $ICONDIR{$dir}; ls -1 |" ); while (<ICONS>) { chop; if (/.xbm$/) { $xbm[$#xbm+1] = $_; } elsif (/.xpm$/) { $xpm[$#xpm+1] = $_; } elsif (/.gif$/) { if (/_motif.gif$/ || /_gr.gif$/ || /^ball_/ || /^line_/) { $gif[$#gif+1] = $_; } else { $gifbutton[$#gifbutton+1] = $_; } } else { if (($dir eq '/images') && (/^[^\.]*$/)) { $xbm[$#xbm+1] = $_; } else { $other[$#other+1] = $_; } } } 1; } sub writefile { open (FP, ">$FILE{$dir}"); print FP "$preindex\n"; print FP "<H1>Bilder im Verzeichnis $dir</H1>\n<P>\n"; foreach $group ( 'xbm', 'xpm', 'gifbutton', 'gif', 'other' ) { @icons = sort eval("\@$group"); if ($#icons >= 0) { print FP "<HR>\n<H2>$HEADER{$group}</H1>\n<HR>\n"; } foreach $icon ( @icons ) { print FP "<IMG ALIGN=BOTTOM SRC=$dir/$icon> $dir/$icon<BR>\n"; } } print FP "$postindex"; 1; }