My other free software | My homepage | Donate
virtualfs-c++ - some virtual filesystemsPackage: virtualfs-c++ 0.3.2 -
download (about 350K)
FUSE is the virtual filesystem for GNU/Linux and other Unix-like OSes.
This package contains advanced C++ bindings for FUSE and several virtual filesystems (written in C++).
Currently this package contains the following filesystems:
Package: virtualfs-c++
Version: 0.2
= Package content and purpose =
This package contains:
* several user space (virtual) filesystems
* advanced C++ bindings for FUSE
= Prerequisites =
FUSE (filesystem in userspace) - http://fuse.sourceforge.net
FUSE consists of a Linux kernel module (included in the official
Linux source from Linux 2.6.14) and the FUSE library.
For FTP filesystem (which is anyway currently broken) is also
needed CommonC++ library.
= List of filesystems =
The following filesystems are included in this package:
* ftpfs
FTP filesystem
* localfs
Second copy of any directory in the mount directory.
It is similar to directory hardlink.
* dereferencefs
Wrapper around an other filesystem which dereferences all
symlinks.
See below about usage (mounting) of these filesystems.
= C++ FUSE bindings =
This package contains advanced C++ bindings for FUSE library.
These bindings are C++ template based.
The C++ FUSE bindings is a preliminary release.
= Mounting =
Mounting of our virtual filesystems is accomplished by shell commands
like (on example of dereferencefs):
dereferencefs /mnt
where /mnt is a mount point (writable by the user).
Options to the filesystem can be given as a comma separated list after
-o flag:
dereferencefs /mnt -o path=/usr/include
== Common options ==
Some options are common for different filesystems.
First there are options common for all FUSE filesystems,
see FUSE documentation.
The following options are also used by more than one filesystem in this
package:
-o path=/<DIR>
Specifies the root of the filesystem that is the directory (e.g.
a directory on the remote server) which is mapped to the mount point.
The default is the root directory.
This option can be alternatively specified as
-path=/<DIR> or --path=/<DIR>
-o dereference_links={0|1}
Specifies whether to dereference all symlinks.
This option applies to dereferencefs and ftpfs.
The default may vary dependently on the filesystem.
These options should become standard options in future releases of
FUSE library.
== Particular filesystems ==
=== localfs ===
This FS simply mirrors a directory in an other filesystem
(by default your root directory).
It is similar to directory symlinks (which are missing in many OSes).
So assuming you have write access to ~/mnt directory,
localfs ~/mnt
will create in ~/mnt a second copy of your root directory.
localfs options:
* -opath=/DIR - specifies which directory is mapped to the mount point.
localfs is intended mainly to be an example and a test and probably has
no important practical usage.
=== dereferencefs ===
This FS dereferences all symbolic links (symlinks) in a directory.
For example
dereferencefs ~/mnt -opath=/DIR
will mirror the dir /DIR in the dir ~/mnt with all symlinks replaced
with their targets. (That is ~/mnt will contain no symlinks.)
In other words, dereferencefs makes symlinks to be transformed into
hard links, except of that:
* Symlinks are not counted in the file links count
* Links to directories as well as link loops are possible.
* Moving a file breaks links to this file.
When you move a symlink to an another directory it is automatically
updated as needed to point to the same place which it was pointing
before. (So when you move symlinks they do not become broken.)
For example if the directory ~/mnt/dir contains a symlink x which
points to y, then moving this symlinks to ~/mnt/dir/subdir will
make it pointing to ../y instead.
An interesting special case is when all symlinks in the mounted
directory DIR (specified by -opath option) point to files which
are outside of DIR. In this case (provided that external files
pointed by the symlinks are not deleted or moved) any file
operations on the files in dereferencefs (in ~/mnt) behave in
such a way as these would be real files not symlinks. (Except that
after deleting a file it may be not really deleted but just look
as if it was deleted because it may really delete a symlink.)
Deleting or moving through dereferencefs a file which is really
a symlink never touches the real file. It only deletes or moves
the symlink.
Note that dereferencefs was developed as a side effect of
development of ftpfs (because an FTP bug needs symlink
dereferencing for a workaround).
dereferencefs options:
* -opath=/DIR - specifies which directory is mapped to the mount point
(that is the directory in which you want to dereference all symlinks).
* -odereference_links={0|1} (default 1) - whether to dereference
symlinks (or leave symlinks as is, in this case dereferencefs behaves
like localfs).
Note that a future version of dereferencefs may probably exclude
-odereference_links option (always forcing it to 1).
= Bugs =
Many, see:
- the file TODO;
- "FIXME" and "TODO" in the source.
However it already works and can be used in practice.
= Tech support =
No tech support.
LD_PRELOAD filesystem emulation hack, which needs no kernel
support.See also above about my development releases of an FTP filesystem (FTPFS v3-0.1).