Miosix  2.0alpha1
miosix::FilesystemManager Class Reference

#include <file_access.h>

Public Member Functions

int kmount (const char *path, intrusive_ref_ptr< FilesystemBase > fs)
 
int umount (const char *path, bool force=false)
 
void umountAll ()
 
ResolvedPath resolvePath (std::string &path, bool followLastSymlink=true)
 

Static Public Member Functions

static FilesystemManagerinstance ()
 

Detailed Description

This class contains information on all the mounted filesystems

Member Function Documentation

FilesystemManager & miosix::FilesystemManager::instance ( )
static
Returns
the instance of the filesystem manager (singleton)
int miosix::FilesystemManager::kmount ( const char *  path,
intrusive_ref_ptr< FilesystemBase fs 
)

Low level mount operation, meant to be used only inside the kernel, and board support packages. It is the only mount operation that can mount the root filesystem.

Parameters
pathpath where to mount the filesystem
fsfilesystem to mount. Ownership of the pointer is transferred to the FilesystemManager class
Returns
0 on success, a negative number on failure
ResolvedPath miosix::FilesystemManager::resolvePath ( std::string &  path,
bool  followLastSymlink = true 
)

Resolve a path to identify the filesystem it belongs

Parameters
pathan absolute path name, that must start with '/'. Note that this is an inout parameter, the string is modified so as to return the full resolved path. In particular, the returned string differs from the passed one by not containing useless path components, such as "/./" and "//", by not containing back path componenets ("/../"), and may be entirely different from the passed one if a symlink was encountered during name resolution. The use of an inout parameter is to minimize the number of copies of the path string, optimizing for speed and size in the common case, but also means that a copy of the original string needs to be made if the original has to be used later.
followLastSymlinktrue if the symlink in the last path component (the one that does not end with a /, if it exists, has to be followed)
Returns
the resolved path
int miosix::FilesystemManager::umount ( const char *  path,
bool  force = false 
)

Unmounts a filesystem

Parameters
pathpath to a filesytem
forcetrue to umount the filesystem even if busy
Returns
0 on success, or a negative number on error
void miosix::FilesystemManager::umountAll ( )

Umount all filesystems, to be called before system shutdown or reboot


The documentation for this class was generated from the following files: