What Is AVFS
AVFS is a system, which enables all programs to look inside archived
or compressed files, or access remote files without recompiling the
programs or changing the kernel.
At the moment it supports floppies, tar and gzip files, zip, bzip2, ar
and rar files, ftp sessions, http, webdav, rsh/rcp, ssh/scp. Quite a
few other handlers are implemented with the Midnight Commander's
AVFS is (C) under the GNU GPL (see the file COPYING). The shared
library supporting AVFS with LD_PRELOAD is (C) unred the GNU LGPL (see
the file COPYING.LIB).
AVFS comes with ABSOLUTELY NO WARRANTY, for details see the file COPYING.
Where Is The Latest Version
Check out the page
Forms of AVFS
AVFS can now be installed in two different ways. These are:
This method in theory works on any Linux system which has the
'coda' filesystem compiled in the kernel or as a kernel module.
In practice it works best with glibc-6.1 or higher, and it has
been tested on 2.2.X and 2.4.X kernels.
Currently this works on solaris systems. There are problems
making the preload method work for GLIBC version 6.1 or
higher, so systems using GLIBC are not supported.
Using AVFS is very similar in both cases. Differences will be indicated.
The installation method is different. For installation instructions
see the files 'INSTALL.preload' and 'INSTALL.avfscoda' respectively.
It is quite simple, you just do everything with the virtual files, as
you would do with real files. Here are some examples:
Listing a tar archive:
ls -l avfs-0.9.1.tgz#/
ls -l avfs-0.9.1.tgz#/avfs-0.9.1/
Obtaining information about avfs itself:
cat /#avfsstat/copyright - prints copyright information and version
cat /#avfsstat/modules - lists available handlers
cat /#avfsstat/version - prints version information
'cd' into an archive:
(For the 'preload' method the shell itself must be started with
Some more examples: (these are all shell commands, but of course you
could use any program: file manager, browser, editor, etc.)
Unpacking an archive:
cp -a tarfile.tgz#/dir .
cp -a zipfile.zip#/* .
(For the 'preload' method, using '*' means that the shell must be
started with AVFS)
Creating an archive:
cp -a dir tarfile.tgz#+/
Note: The efficiency of this method is not yet the same as the
'normal' archive creation method, but it should not be more than 2
2) ('preload' only) Input and output redirection to/from virtual files
does not work. This is not a problem with the 'avfscoda' method.
E.g. you can't do
patch -p0 < patchfile.gz#
cat patchfile.gz# | patch -p0
If something doesn't work, then check the section 'Common Problems'.
Format of an AVFS Path
(For a full explanation of the format see the file FORMAT)
As you've seen, the '#' magic character makes a virtual file or
directory from an ordinary file. Actually this is just a shorthand for
the full specification of an AVFS path:
'tarfile.tgz#' is the same as 'tarfile.tgz#ugz#utar'
Note, the short version will only work if the file-extension is
recognized (most are), but you can always tell exactly what should be
done with the file by using the second method.
There are handlers which do not have a "base" file. The following
handlers are like this: floppy, ftp, rsh, ssh, http, dav, avfsstat,
/#floppy:a - a: drive
/#a - a: drive (alias for /#floppy:a)
/#rsh:otherhost/foo/bar - /foo/bar on 'otherhost'
/#ssh:user@host/dir - /dir on 'host', login as 'user'
/#ftp:ftp.funet.fi/pub/Linux - anonymous ftp
/#ftp:firstname.lastname@example.org/home/xyz/file - ftp with username 'user'
/#ftp_ctl:email@example.com/password - write the password to this file
(ftppass is a nice utility for this)
/#http:www.inf.bme.hu|~mszeredi|avfs| - homepage of AVFS
/#http:ftp:||ftp.funet.fi|pub|Linux - use HTTP to get an ftp URL
(useful if you use a HTTP-only proxy)
The environment variable 'http_proxy' is used to set the default value
of the proxy server. You can also set it's value by writing to the file
The following "handelers" are available now:
name of handler type of operation notes
--------------- ----------------- -----
#ugz gunzip builtin,
#ugzip gunzip uses gzip
#uz uncompress uses gzip
#gz gzip uses gzip
#ubz2 bunzip2 builtin
#ubzip2 bunzip2 uses bzip2
#bz2 bzip2 uses bzip2
#utar untar builtin
#uzip unzip builtin
#urar unrar builtin list + uses rar to extract
#uar un-ar builtin
#avfsstat meta information builtin
#floppy floppy uses mtools (mdir, mcopy, ...)
#a first floppy drive alias for #floppy:a
#rsh rsh/rcp only works if rsh needs no password
#ssh ssh/scp only works if ssh needs no password
#ftp ftp builtin
#ftp_ctl control ftp sessions
#dav webdav builtin
#dav_ctl control dav sessions
#volatile 'memory fs' mainly for testing
#local local filesysem only for internal use
The following handlers are available through Midnight Commanders
'extfs'. These were not written by me, and could contain security
holes. Nonetheless some of them are quite useful. For documentation
on these, see the files in /usr/lib/avfs/extfs.
name of handler type of operation
#uzoo zoo archives
#ulha lha archives
#ucpio cpio archives
#rpm rpm packages
#deb debian packages
#lslR directory tree listings
#patchfs browse patch files
#rpms List of installed rpms
#trpm Useful inside #rpms
Writing new modules
You want to write a handler module for XY? Great! Please contact me,
and I can give you some advice regarding this.
David Hanak (firstname.lastname@example.org) has contibuted the "rar" and the
"archive" modules, and lots of ideas to AVFS.
The VFS in Midnight Commander, written by Jakub Jelinek and Miguel de
Icaza <email@example.com>, has greatly helped me write this
library, and will probably continue to do so in the future.
Pavel Machek, who is the current maintainer of Midnight VFS, and who
has contributed lots of ideas and the alien module (which
unfortunately I did not have time to get into shape) to AVFS. The
'avfscoda' solution grew out of Pavels 'podfuk'. Most of it has been
changed, but the original idea is from Pavel.
Justin Mason <firstname.lastname@example.org> contributed the dav module.
Koblinger Egmont <email@example.com> has written the "recursive
profile" scripts, set up the mailing list, and also sent me many good
The zip and gzip file handler is based on the zlib compression and
decompression library, written by Jean-loup Gailly and Mark Adler.
The bzip2 handler uses the libbzip2 library written by Julian R
The tar file handler is based on the GNU tar source, originally
written by John Gilmore.
People, who sent me ideas or bug-reports:
Jan Niehusmann <firstname.lastname@example.org>
Demon of the Known Universe <email@example.com>
Duncan Pierce <firstname.lastname@example.org>
Scott F. Johnston <email@example.com>
Larry Riedel <firstname.lastname@example.org>
I hope AVFS will grow up to be a standard virtual file library, for which
people can write handler modules (or plugins, if you like) for whatever
If you thing AVFS is a good idea, and you have any comments or suggestions,
please send me an email about them.
Miklos Szeredi <email@example.com>