21#include "filesystem/FileSystem.h"
22#include "platform/FileHandle.h"
79 virtual ssize_t
read(
void *buffer,
size_t size);
87 virtual ssize_t
write(
const void *buffer,
size_t size);
110 virtual off_t
seek(off_t offset,
int whence = SEEK_SET);
virtual int open(FileSystem *fs, const char *path, int flags=O_RDONLY)
Open a file on the filesystem.
virtual int close()
Close a file.
virtual off_t tell()
Get the file position of the file.
virtual int truncate(off_t length)
Truncate or extend a file.
virtual ~File()
Destroy a file.
virtual ssize_t read(void *buffer, size_t size)
Read the contents of a file into a buffer.
virtual int isatty()
Check if the file in an interactive terminal device.
virtual int sync()
Flush any buffers associated with the file.
File(FileSystem *fs, const char *path, int flags=O_RDONLY)
Create a file on a filesystem.
File()
Create an uninitialized file.
virtual ssize_t write(const void *buffer, size_t size)
Write the contents of a buffer to a file.
virtual off_t size()
Get the size of the file.
virtual off_t seek(off_t offset, int whence=SEEK_SET)
Move the file position to a given offset from from a given location.
virtual void rewind()
Rewind the file position to the beginning of the file.