Re: Program database

From: Rhialto <>
Date: Sat, 19 Sep 2009 23:45:58 +0200
Message-ID: <>
On Wed 16 Sep 2009 at 09:56:12 +0200, wrote:
> I have a lot of CD's filled with images and I'm sure that I have more
> then one copy of a lot of files. But finding files is a problem as well.
> Having a database could simplify things. So my first question: is there
> a program available that enables you to read floppies/images and to
> store the information about programs, headers, sizes etc. in a database?

Well, I once made a shell script to look through a directory tree (on
Unix) and try to list all C= files inside various image files and
compression/archive files. It does require various helper programs for
looking inside files.

It doesn't do anything database-like; it just outputs

I'll include it here, it isn't that big.

___ Olaf 'Rhialto' Seibert    -- You author it, and I'll reader it.
\X/ rhialto/at/      -- Cetero censeo "authored" delendum esse.
#set -x


ls -lR >ls-lR
du -k >du-k

find $here -type f -print |
egrep -i '\.(zip|lha|lzh|zoo|[dDtT]64|lnx|tar\.gz|tgz|lnx\.gz|d64\.gz)$' |
sort -f |
while read fn
	#echo "fn = $fn"

	mkdir $tmpdir || { echo "Cannot mkdir $tmpdir"; exit 1; }
	cd $tmpdir

	echo ""
	case $fn in
		unzip -l "$fn" 2>&1
		unzip "$fn" '*.[dDtT]64' '[1-4]!*' '*.lnx' >/dev/null 2>&1
		# lha reads stdin... feed it nothing.
		echo "Archive:  $fn"
		lha l "$fn" </dev/null 2>&1 
		lha x "$fn" '*.?64' '?!*' '*.lnx' </dev/null >/dev/null 2>&1
		ln -s "$fn" .
		echo "Archive:  $fn"
		tar tvzf "$fn"
		tar xvzf "$fn" '*.[dDtT]64' '[1-4]!*' '*.lnx' >/dev/null 2>&1
		gunzip <$fn >`basename $fn .gz`

	find . -print |
	egrep '\.([dDtT]64|lnx)|[1-4]!' |
	while read image
		#echo "image = $image"

		case "$image" in
			echo "Directory of $fn -> $image:"
			c1541 "$image" -list 2>&1 | grep -v "VDrive:"
			echo "Tape contents of $fn -> $image:"
			# we want to see stderr only here
			c1541 -format "no name,00" d81 noname -tape "$image" 2>&1 1>/dev/null
			echo "Directory of $fn -> $image:"
			c1541 -format "no name,00" d64 noname -unlynx "$image" -list 2>&1 | grep '^[0-9]'
			echo "Directory of $fn -> $image:"
			zipname=`echo $image | sed 's/^....//'`
			c1541 -zcreate noname "$zipname" -attach noname -list 2>&1 | grep '^[0-9]'

	cd /tmp
	rm -rf $tmpdir
done |
sed 's;'$here';;g' |
tee /dev/tty |
gzip -v9 > unpacked-contents.gz

       Message was sent through the cbm-hackers mailing list
Received on 2009-09-19 23:00:04

Archive generated by hypermail 2.2.0.