3 # Output the contents of a file
5 require './software-lib.pl';
6 $p = $ENV{'PATH_INFO'};
8 # Try to guess type from filename
9 if ($p =~ /\.([^\.\/]+)$/) {
11 &get_miniserv_config(\%miniserv);
12 open(MIME, $miniserv{'mimetypes'});
16 foreach $e (split(/\s+/, $2)) {
27 # No idea .. use the 'file' command
28 if (`file "$p"` =~ /text|script/) {
32 $type = "application/octet-stream";
37 if (!open(FILE, "<$p")) {
38 print "Content-type: text/plain\n\n";
39 print &text('list_eview', $p, $!),"\n";
43 print "Content-length: $st[7]\n";
44 print "Content-type: $type\n\n";
45 while(read(FILE, $buf, 1024)) {