            Writing scripts for GNU Smalltalk's external vfs
                   (based on the Midnight Commander)

Starting with version 1.96.5, GNU Smalltalk includes the Midnight
Commander's virtual filesystem layer.  One of the virtual filesystems,
implemented by the ExternalArchiveFileHandler class, makes it possible
to create new virtual filesystems for GNU Smalltalk very easily (this
was not implemented until 2.0c, however).

This is achieved simply by creating a shell script/program to handle
requests.  (Note: $(sharedir) should be substituted for actual
sharedir path stored when configured or compiled, like
/usr/local/share/smalltalk or /usr/share/smalltalk).

The script must be called with the vfs suffix you give to your
filesystem. For example, if you have .zip file, and would like to see
what's inside it, path will be

/anypath/my.zip#uzip/some_path/...

In this example, .zip is suffix, but I call vfs 'uzip'. Why? Well,
what this vfs essentially does is UNzip. UN is too long, so I choosed
U. Note that sometime in future filesystem like zip may exist: It will
take whole tree and create .zip file from it. So /usr#zip will be
zipfile containing whole /usr tree.

You then have to create a program (with executable permissions) prefix
in $(sharedir)/extfs (in our example $(sharedir)/extfs/uzip).

* Commands that should be implemented by your shell script
----------------------------------------------------------

Return zero from your script upon completion of the command, otherwise
nonzero for failure or in case of an unsupported command.

$libdir/extfs/prefix command [arguments]

* Command: list archivename

This command should list the complete archive content in the following format
(a little modified ls -l listing):

AAAAAAA NNN OOOOOOOO GGGGGGGG SSSSSSSS DATETIME [PATH/]FILENAME [-> [PATH/]FILENAME[/]]]

where (things in [] are optional):

AAAAAAA  is the permission string like in ls -l
NNN      is the number of links
OOOOOOOO is the owner (either UID or name)
GGGGGGGG is the group (either GID or name)
SSSSSSSS is the file size
FILENAME is the filename
PATH     is the path from the archive's root without the leading slash (/)
DATETIME has one of the following formats:
	    Mon DD hh:mm, Mon DD YYYY, Mon DD YYYY hh:mm, MM-DD-YY hh:mm

            where Mon is a three digit english month name, DD day
            1-31, MM month 01-12, YY two digit year, YYYY four digit
            year, hh hour and mm minute.

If the -> [PATH/]FILENAME part is present, it means:

If permissions start with an l (ell), then it is the name that symlink
points to. (If this PATH starts with a MC vfs prefix, then it is a
symlink somewhere to the other virtual filesystem (if you want to
specify path from the local root, use local:/path_name instead of
/path_name, since /path_name means from root of the archive listed).

If permissions do not start with l, but number of links is greater
than one, then it says that this file should be a hardlinked with the
other file.

* Command: copyout archivename storedfilename extractto

This should extract from archive archivename the file called
storedfilename (possibly with path if not located in archive's root
[this is wrong. current extfs strips paths! -- pavel@ucw.cz]) to file
extractto.  This is called before accessing a virtual file.

* Command: copyin archivename storedfilename sourcefile

This should add to the archivename the sourcefile with the name
storedfilename inside the archive.  This is called after accessing
a virtual file that was opened for output.

Important note: archivename in the above examples may not have the
extension you are expecting to have, like it may happen that
archivename will be something like /tmp/f43513254 or just
anything. Some archivers do not like it, so you'll have to find some
workaround.

* Command: rm archivename storedfilename

This should remove storedfilename from archivename.

* Command: mkdir archivename dirname

This should create a new directory called dirname inside archivename.

* Command: rmdir archivename dirname

This should remove an existing directory dirname. If the directory is
not empty, mc will recursively delete it (possibly prompting).

---------------------------------------------------------

Don't forget to mark this file executable (chmod 755 ThisFile, for example)

For skeleton structure of executable, look at some of filesystems
similar to yours.

---------------------------------------------------------

In constructing these routines, errors will be made.  Since this
routine is an executable shell script it can be run from the command
line independently of mc, and its output will show on the console or
can be redirected to a file.
