In 1992, Tim Cook, then a Systems Administrator at Deakin University in Australia, wrote two very useful CLI utilities named dl and describe. In the introduction, he asks a very valid question:

Have you ever wondered what on earth "xfrg2.2.tar.Z" was? Are you wondering whether "foo" is really a scratch file? Does it ashame you especially, seeing that these files were created by you?

My answer to the question is often a resounding Yes!. I have wondered. The two programs aid in setting meta data for files on Unix/Linux. I've used them incessantly since then, but I'm also sure that Tim's code has disappeared into nothingness, and I wanted to revive it. ;-) The archives of alt.sources are a bit hard to find; the group's FAQ was last updated in May 2004 and the FTP servers of its archives are unreachable (to me). I searched alt.sources for describe v1.8, and on the resulting page for the word describe, which leads me to the four parts. Tim's original posting was on May 14, 1992. Therein you'll find the sources to dl/describe: show the original format and then save as part01.sh through part04.sh. After that, if you have unshar, simply run

$ unshar part0?.sh

to have all files extracted to the current directory. Otherwise, ensure each of the part0?.sh files has nothing before the hash bang (i.e. before the line containing #!/bin/sh) and run each through a shell:

$ for i in part0?.sh; do sh $i; done

Tweaking the Makefile and the config.h file should be simple (I can make a tar file available on request). A make then suffices to build the two binaries named dl and describe. Using describe and dl is very easy, if only because the manual pages are very good. In principle, describe is used to set a description on a file, and dl (think d_irectory l_ist) shows the details. Let us see this in operation. First is a typical listing using the ls command. I then proceed to describe two new files in that directory, giving the command a filename and a description of the file. describe stores the meta data in a "hidden" file (a filename that begins with a period), and it is resilient to files being renamed: they don't loose their description, because describe also stores the inode number. At any later time I use dl to list the files, their sizes and, most importantly, their descriptions. Since I'm sometimes a strong believer in backups, what I periodically do is to dump the descriptions into a file that I can use to reload the database with.

$ describe -l > 00index
$ cat 00index
doit.c               Demo C function for linking with MingW
README               Instructions: start here
jpm.jpg              Passport photo: 120x184
j00000019.avi        Outing with Julie in November 2004

Should the meta data database (called .desc on my system with a DBM-specific extension) at any time become corrupt, I can reload it with

$ rm -f .desc.???
$ describe -f 00index

After almost fifteen years, I still use Tim's software regularly. Thank you Tim Cook.

Flattr this
Linux, Database, MacOSX, and CLI :: 11 Jan 2007 :: e-mail

Comments

blog comments powered by Disqus