			ftpfs - FTP filesystem

			    *** BEWARE ***
This is a new experimental filesystem.  It has never been tested on
the open Internet.  If something goes wrong, it can quite easily
saturate an FTP site and generate a lot of network bandwidth.
			    **************

This filesystem allows FTP sites to be accessed in a filesystem-like
way.  Normally they will be anonymous FTP sites, but non-anonymous
ones can be set up.

It should be mounted like so:
	muserfs ftpfs mount-point cache-dir

The cache dir contains a long-term cache of the ftp'd data to minimize
network use.  The filesystem shape and the cache dir have the same
shape: there is a directory for each site in the top directory, with
the tree for that site underneath.

To connect to a new site, type "mkdir sitename" (where sitename is a
hostname, fully qualified if necessary) in the top filesystem
directory.  This will resolve the name and create a new cache
directory.  After that, you can just cd into the site and look around.
Inaccessable directories appear to be empty, but otherwise the
filesystem looks just like the ftp site.  Files which are out of date
or not present in the cache are transferred as required; otherwise
they are just fetched from the local cache.

There are a number of config and parameter files about.  They all have
the same format: one parameter per line in the form "name: value".

Each site dir in the cache tree has a file called ".ftpfs_site" which
has site-related parameters.  "username" and "password" are supported,
because any user can mount the filesystem, users can have private
cache directories with secret usernames and passwords (so long as the
cache has 700 permissions).  Also there are also "failure_timeout"
(time before retying after an error) and "update_timeout" (time to
update after the last update, without any other reason).  Both are in
seconds.  "timezone" is for timezone correction of times from the
remote site, measured in number of minutes needed to be added to the
time to make it UTC (GMT).  ftpfs makes an attempt to find the local
time at target machines to determine this automatically, but anonymous
FTP sites often give times and dates in UTC anyway.

Also, if you touch the file ".ftpfs_update" in any directory in the
filesystem (which never exists), it causes the directory its in to be
updated.

Each directory in the cache (apart from the very top one) has a
".ftpfs_dir" file containing per-directory information.  There are a
couple of valid parameters it uses: "last_update", which is the time
the directory was last looked at on the ftp site (0 if it hasn't), and
"last_failure" which is the last time this dir failed to be updated.
Each directory also has a ".ftpfs_dirinfo" file, which contains
information about files in the directory, even if they have not been
transferred yet.

Also, the filesystem only copes with unix ftp sites.  Parsers for
different pathname syntaxes and LIST outputs have to be written for
other OS types.

This filesystem uses a threads library to maintain multiple threads of
execution.  This allows more than one process to use the filesystem at
once.  For example, even if one process is reading from a long FTP
transfer, other processes can use other FTP sites, or even the same
one without being affected much (response time is slower, but its
better than nothing).  Unfortunately, since the filesystem only
maintains one FTP connection per site, only one file at a time can be
read from an FTP site.  I may fix this in future to allow more than
one FTP connection per site.

There is a perl script "reap.pl" which prunes ftpfs cache trees of
old files to keep the total cache size below some preset size.
At present this needs to be invoked from a cron job or some similar
mechanism, though in future ftpfs may invoke it itself if the cache
is full.

	J
