avfs  1.1.4
About: AVFS (A Virtual File System) is an system which enables all programs to look inside archived or compressed files, or access remote files without recompiling the programs or changing the kernel.
  Fossies Dox: avfs-1.1.4.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

avfs Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies avfs-1.1.4.tar.bz2 contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).
README
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
external FS.

AVFS is (C) under the GNU GPL (see the file COPYING). The shared
library is (C) under 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

  http://www.inf.bme.hu/~mszeredi/avfs/

or

  http://sourceforge.net/projects/avf

Forms of AVFS
-------------

AVFS can now be installed in four different ways. These are:

 - Fuse
 	With fuse support, systems with 2.6 kernels are able to use avfs.
	The requirements are 
	1) fuse support be compiled into the kernel or fuse modules 
	   loaded.
	2) the fuse package and library >= 2.4 be installed.
	
 - Library
        AVFS can be used as a shared library for programs written to
        utilize AVFS. This is a pure userspace library so it should
        work on any POSIX system.

Using AVFS is very similar in all cases. Differences will be indicated.

The installation method is different. For installation instructions
see the files 'INSTALL.fuse' and 'INSTALL.library' respectively all
located in the doc/ directory.

Using AVFS
----------

These instructions are not for the fuse installation. Please see the file
README.avfs-fuse for details on how these commands are applied.

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:

  cd avfs-0.9.1.tgz#/
  less avfs-0.9.1/README

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#/* .

Creating an archive:

  mkdir tarfile.tgz#+  
  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
  times slower.


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,
volatile, rpms, ucftp.

Examples

  /#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:user@host.domain.org/home/xyz/file   - ftp with username 'user'
  /#ftp_ctl:user@host.domain.org/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)
  /#dav:http:host.domain.org/home/           - WebDAV

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

   /#avfsstat/http_proxy


The following "handlers" are available now:

  name of handler    type of operation      notes
  ---------------    -----------------      -----
  #a                 first floppy drive     alias for #floppy:a
  #avfsstat          meta information       builtin
  #bz2               bzip2                  uses bzip2
  #dav               webdav                 builtin
  #dav_ctl           control dav sessions   
  #floppy            floppy                 uses mtools (mdir, mcopy, ...)
  #ftp               ftp                    builtin
  #ftp_ctl           control ftp sessions   
  #gz                gzip                   uses gzip
  #iso9660           CD/DVD filesystem      no need to use mount -t iso9660!
  #local             local filesysem        only for internal use
  #rsh               rsh/rcp                only works if rsh needs no password
  #ssh               ssh/scp                only works if ssh needs no password
  #uar               un-ar                  builtin
  #ubz2              bunzip2                builtin
  #ubzip2            bunzip2                uses bzip2
  #ucftp             ftp                    builtin (write support, no file cache)
  #ucftp_ctl         control ftp sessions   
  #ugz               gunzip                 builtin (1)
  #ugzip             gunzip                 uses gzip
  #ulzip             unlzip                 builtin
  #urar              unrar                  builtin list + uses rar to extract
  #utar              untar                  builtin
  #uxz               unxz/unlzma            builtin
  #uxze              unxz/unlzma            uses xz
  #uz                uncompress             uses gzip
  #uzip              unzip                  builtin
  #uzstd             uzstd                  builtin
  #uzstde            uzstd                  uses zstd
  #volatile          'memory fs'            mainly for testing
  

(1) With the '-s' option (blala.gz#-s) the gunzip module will use the
size stored at the end of the gzip file.  This will make some
operations on a .gz file much faster, but it isn't usable for huge
(>=4GByte) files, since the size is stored in 32 bits :(.

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
  ---------------    -----------------
  #deb               debian packages
  #ftplist           ?
  #hp48              ?
  #lslR              directory tree listings
  #mailfs            ? 
  #patchfs           browse patch files
  #rpm               rpm packages
  #rpms              List of installed rpms
  #trpm              Useful inside #rpms
  #ucpio             cpio archives
  #ulha              lha archives
  #uzoo              zoo archives


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.

Credits
-------

David Hanak (dhanak@inf.bme.hu) 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 <miguel@nuclecu.unam.mx>, 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 <jm-avfs@jmason.org> contributed the dav module.

Koblinger Egmont <egmont@fazekas.hu> has written the "recursive
profile" scripts, set up the mailing list, and also sent me many good
ideas.

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
Seward.

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 <jan@gondor.com>
  Demon of the Known Universe <psycho@dodds.net>
  Duncan Pierce <cmrdrp@soc.staffs.ac.uk>
  Scott F. Johnston <scott@fleetingimage.com>
  Larry Riedel <larry@riedel.org>

The Future
----------

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
they want. 

If you think AVFS is a good idea, and you have any comments or suggestions,
please send me an email about them.

Have fun,

Miklos Szeredi <miklos@szeredi.hu>