TIP: Click on subject to list as thread! ANSI
echo: unix
to: All
from: andrew clarke
date: 2003-02-15 13:13:34
subject: files.bbs to .htaccess

* Crossposted in area linux_bbs, linux, unix

This may be useful for UNIX people ("ooh, look mummy, it's the UNIX
people!") running BBSes.  This morning I wrote a script to extract
file_id.diz from zip files and add them to a files.bbs:

#!/bin/sh

for i in *; do
  echo -n $i >> files.bbs
  echo -n " " >> files.bbs
  unzip -Cap $i file_id.diz | tr "\n" " " >> files.bbs
  echo >> files.bbs
done

I also wrote a script to convert files.bbs to .htaccess format, for use with Apache.

#!/bin/sh
awk '{ filename = $1; $1 = ""; sub(" ", "");
printf "AddDescription \"%s\" %s\n", $0, filename }'
<
files.bbs | tee .htaccess

Which means that any files located in autoindexed directories (directories
without a default index.html or equivalent) on my web server will now have
their own descriptions.  Unfortunately long descriptions don't word-wrap,
but I can't think of a good solution for that yet.

You'll probably need to edit the default httpd.conf for this to work
(changing the OptionsOverride and DescriptionWidth options, from memory).

-- mail{at}ozzmosis.com

--- Msged/NT 6.1.1
* Origin: Blizzard of Ozz, Mt Eliza, Victoria, Australia (3:633/267.1)
SEEN-BY: 633/270
@PATH: 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.