#pragma once #include "VirtualFileSystem.h" #include class FileHandle { public: explicit FileHandle(RetainPtr&&); ~FileHandle(); Unix::off_t seek(Unix::off_t, int whence); Unix::ssize_t read(byte* buffer, Unix::size_t count); int stat(Unix::stat*); ByteBuffer readEntireFile(); #ifdef SERENITY_KERNEL int fd() const { return m_fd; } void setFD(int fd) { m_fd = fd; } #endif private: friend class VirtualFileSystem; RetainPtr m_vnode; Unix::off_t m_currentOffset { 0 }; #ifdef SERENITY_KERNEL int m_fd { -1 }; #endif };