            Writing scripts for Midnight Commander's external vfs

IMPORTANT NOTE: extfs is not officialy released and fully bug free
in 3.0! You have been warned. If you would really like to try it,
you can (by typing make install.extfs in the vfs directory).

Starting with version 3.1, the Midnight Commander comes with so called
extfs, which is one of the virtual filesystems. This system makes it
possible to create new virtual filesystems for the GNU MC very easily.

Such work has two basic steps:

Editing $(libdir)/extfs/extfs.ini.
Creating a shell script/program to handle requests.
(Note: $(libdir) should be substituted for actual libdir path stored when
configured or compiled, like /usr/local/lib/mc or /usr/lib/mc).

The first one is very easy:
You assign a vfs prefix and vfs extensions to your vfs. Both will be used in
vfs pseudoURL names, like if you assign prefix zip and extensions .zip,
.ZIP, then URLs will look like
zip:anypath/my.zip/some_path/in_the/archive
Then you add a line to the end of the [extfs] section:
prefix=space_separated_extensions
e.g.
zip=.zip .ZIP

The second one my require some your knowledges of shell/c programming:
You have to create a program (with executable permissions) prefix in
$(libdir)/extfs (in our example $(libdir)/extfs/zip).

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

$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)
to file extractto.

* Command: copyin archivename storedfilename sourcefile

This should add to the archivename the sourcefile with the name
storedfilename inside the archive.  

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.

