Introduction
eVFS is a lightweight, yet powerful filesystem abstraction layer created using the
Enlightenment Foundation Libraries (EFL). It
aims to replace all common file functions in general application programming, whilst
maintaining the ability to interoperate between a variety of filesystem types, both
local and remote.
In contrast to other virtual filesystem offerings, eVFS offers only an asyncronous
toolkit - that is, communication between the eVFS daemon, and a client application,
occurs as a series of messages and responses, rather than taking control away from
the client during operation execution. Such a design ties in with the general
philosophy of the EFL - a threadless, yet responsive toolkit providing maximum
stability, whilst remaining powerful.
Components
eVFS comprises a number of components, not all of which you will need to become
familiar with. The base components are:
- The eVFS daemon
- The client library
- Modules
Client/Server Interaction
Daemon Connection
A client wishing to make use of eVFS functionality must first connect to the daemon
itself. If the daemon is not running at the time of the connection request, a new
eVFS daemon will be launched with the permissions of the current user.
An eVFS connection object is a variable of the form:
evfs_connection *con;
To make a new connection to the eVFS daemon, you call the function evfs_connect,
defined as:
evfs_connection *evfs_connect(void (*callback_func) (evfs_event *, void *), void* obj);
The arguments are, in order, the callback function to call with command responses and events, and the object (if any)
return as a client-reference.
evfs_filereference object
An evfs_filereference is an abstract representation of a file on a filesystem.
An evfs_filereference is defined as:
typedef struct evfs_filereference
{
char *plugin_uri;
struct evfs_plugin *plugin;
struct evfs_filereference *parent;
struct evfs_server *server; /*The server that spawned/owns this fileref, if any */
evfs_file_type file_type;
char *path;
char *username; /*The username/password pair (if any) required to hit this file */
char *password;
int fd; /*The file descriptor (if any) */
void *fd_p;
} evfs_filereference;
An evfs filereference can refer to a nested file (See the section on URIs in this manual). That is to say, a
filereference can refer to a file in a .bz2, inside a .tar, on a remote samba share. This is acheived through
the parent object, as seen above. In each evfs_filereference, parent is set to either
another evfs_filereference, or NULL - with the NULL being at the top level. The structure can be seen,
for example, as below:
(tar) '/inner/directory/example.c' -> (bz2) files.tar.bz2 -> (samba) //machine/example
This would be expressed as a uri in the form:
smb:///machine/example/files.tar.bz2#bz2://#tar:///inner/directory/example.c
Generally, as a user of the evfs client libraries, you will not need to manipulate filereferences
directly, but it is a good idea to become familiar with their internal structure, so as to understand
their recursive nature. Through the use of nested URIs, you can refer to any file, on any filesystem,
or group of filesystems, that eVFS can manipulate.
evfs_parse_uri
The evfs_parse_uri function turns a URI as seen above, into the nested filereference objects,
thus automating the transition between a textual file format, and the eVFS internal representation.
Client File Commands
evfs_monitor_add
evfs_monitor_remove
evfs_client_file_remove
evfs_client_file_rename
evfs_client_file_stat
evfs_client_dir_list
evfs_client_file_open
evfs_client_file_copy
evfs_client_file_read
evfs_client_operation_respond
evfs_client_directory_create
evfs_client_metadata_retrieve
Writing eVFS Modules
Module Types
File modules
Metadata modules