genode/ports/src/noux/directory_service.h
Norman Feske 66290ea46d Stacked file systems for Noux
This patch introduces support for stacked file systems alongside new
glue for accessing file-system implementations provided via Genode's
new file-system-session interface.

Using stacked file systems, an arbitrary number of file systems (such
as tar archives or file systems implemented as separate Genode
components) can be composed to form one merged virtual file system.

An example is given via the 'ports/run/noux_bash.run' script. This run
script creates a virtual file system out of multiple tar archives each
containing the content of a particular GNU package. In addition, one
'ram_fs' is mounted, which enables Noux to perform write operations.
This way, the shell output can be redirected to a file, or files can
be saved in VIM.

Fixes #103.
2012-05-17 20:34:00 +02:00

56 lines
1.4 KiB
C++

/*
* \brief Directory-service interface
* \author Norman Feske
* \date 2011-02-17
*/
/*
* Copyright (C) 2011-2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _NOUX__DIRECTORY_SERVICE_H_
#define _NOUX__DIRECTORY_SERVICE_H_
/* Genode includes */
#include <dataspace/capability.h>
/* Noux includes */
#include <noux_session/sysio.h>
namespace Noux {
class Vfs_handle;
/**
* Abstract interface to stateless directory service
*/
struct Directory_service
{
virtual Dataspace_capability dataspace(char const *path) = 0;
virtual void release(char const *path, Dataspace_capability) = 0;
virtual Vfs_handle *open(Sysio *sysio, char const *path) = 0;
virtual bool stat(Sysio *sysio, char const *path) = 0;
virtual bool dirent(Sysio *sysio, char const *path, off_t index) = 0;
virtual bool unlink(Sysio *sysio, char const *path) = 0;
virtual bool rename(Sysio *sysio, char const *from_path,
char const *to_path) = 0;
virtual bool mkdir(Sysio *sysio, char const *path) = 0;
/**
* Return number of directory entries located at given path
*/
virtual size_t num_dirent(char const *path) = 0;
virtual bool is_directory(char const *path) = 0;
virtual char const *leaf_path(char const *path) = 0;
};
}
#endif /* _NOUX__DIRECTORY_SERVICE_H_ */