Go to the documentation of this file.
45 if (copied <
sizeof(fullpath))
64 ERROR(
"failed to send request to PID " << pid <<
65 " for path " << msg.
buffer <<
": result = " << (
int) r);
96 ERROR(
"failed to redirect request to PID " << msg.
pid <<
97 " for path " << msg.
buffer <<
": result = " << (
int) r);
116 if (copied <
sizeof(fullpath))
180 msg.
buffer = (
char *)path;
192 msg.
buffer = (
char *)path;
199 Size & descriptor)
const
234 if (!fd || !fd->
open)
262 if (!fd || !fd->
open)
291 msg.
buffer = (
char *)path;
299 const Size msecTimeout)
const
306 msg.
buffer = (
char *) waitSet;
309 if (msecTimeout != 0)
329 msg.
buffer = (
char *) mountPath;
339 msg.
buffer = (
char *) path;
Size position
< Process identifier of the filesystem
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
FileSystem::Result createFile(const char *path, const FileSystem::FileType type, const FileSystem::FileModes mode) const
Create a new file.
static const Size MaximumFileSystemMounts
Maximum number of mounted filesystems.
static ChannelClient * instance()
Retrieve the instance.
Size length() const
Same as count().
char * buffer
Points to a buffer for I/O.
FileType
All possible filetypes.
Represents a mounted filesystem.
FileSystem::Result statFile(const char *path, FileSystem::FileStat *st) const
Retrieve status of a file.
FileSystem::FileStat * stat
File Statistics.
bool open
< Current position indicator.
FileSystem::Result waitFileSystem(const char *path) const
Blocking wait for a mounted filesystem.
Provides information about an inode.
Type type
Message type is either a request or response.
FileSystem::Result mountFileSystem(const char *mountPath) const
Mount the current process as a file system on the rootfs.
Provides the timer of the kernel.
u32 ProcessID
Process Identification Number.
FileSystem::Result deleteFile(const char *path) const
Remove a file from the file system.
Abstracts files which are opened by a user process.
FileSystemClient(const ProcessID pid=ANY)
Class constructor function.
FileModes access
< Process identifier of filesystem
Size offset
Offset in the file for I/O.
virtual int compareTo(const String &str) const
Compares this String to the given String.
FileSystem::Result result
Result code.
FileSystem::Result request(const char *path, FileSystemMessage &msg) const
Send an IPC request to the target file system.
const ProcessID m_pid
ProcessID of the target file system or ANY to lookup in mounts table.
static String * m_currentDirectory
Current directory path is prefixed to relative path inputs.
const String * getCurrentDirectory() const
Get current directory String.
u32 inode
Inode number of the file.
Entry * getEntry(const Size index)
Retrieve a file descriptor Entry.
FileSystem::Result writeFile(const Size descriptor, const void *buf, Size *size) const
Write a file.
static const Size MaximumLength
Maximum length of a filesystem path in bytes.
FileSystem::Result closeFile(const Size descriptor) const
Close a file.
ulong options
Mount options.
Describes a single file opened by a user process.
FileSystem::Result openFile(const char *path, Size &descriptor) const
Open a file.
void setCurrentDirectory(const String &directory)
Set new current directory.
static FileSystemMount m_mounts[MaximumFileSystemMounts]
FileSystem mounts table.
ProcessID procID
Server which is responsible for the mount.
Result closeEntry(const Size index)
Remove file descriptor entry.
#define NULL
NULL means zero.
unsigned int Size
Any sane size indicator cannot go negative.
virtual Result syncSendReceive(void *buffer, const Size msgSize, const ProcessID pid)
Synchronous send and receive to/from one process.
FileSystemMount * getFileSystems(Size &numberOfMounts) const
Get file system mounts table.
FileSystem::Result readFile(const Size descriptor, void *buf, Size *size) const
Read a file.
ProcessID findMount(const char *path) const
Retrieve the ProcessID of the FileSystemMount for the given path.
u16 FileModes
Multiple FileMode values combined.
Result openEntry(const u32 inode, const ProcessID filesystem, Size &index)
Add new file descriptor entry.
#define assert(exp)
Insert program diagnostics.
Contains file information.
#define ERROR(msg)
Output an error message.
char path[FileSystemPath::MaximumLength]
Path of the mount.
virtual Result tick()
Process timer tick.
Result
Result code for filesystem Actions.
ProcessID pid
< Inode number of the file
Size pathMountLength
Length of the mounted path (used for redirection)
ProcessID pid
Process identifier (used for redirection)
FileSystem::Action action
Action to perform.
FileSystem::Result waitFile(const char *filesystemPath, const FileSystem::WaitSet *waitSet, const Size count, const Size msecTimeout) const
Wait for one or more files to become readable/writable.
Timer::Info timeout
Timeout value for the action.
ProcessID pid
< Inode number
virtual Result getCurrent(Info *info, const Size msecOffset=0)
Get current timer info.
Size size
Size of the buffer.