28 #ifndef _H_FILESYSTEM_ 29 #define _H_FILESYSTEM_ 105 #define TAR_TYPE_FILE '0' 106 #define TAR_TYPE_HARDLINK '1' 107 #define TAR_TYPE_SYMLINK '2' 108 #define TAR_TYPE_DEVICE '3' 109 #define TAR_TYPE_BLOCKDEV '4' 110 #define TAR_TYPE_DIRECTORY '5' 111 #define TAR_TYPE_NAMEDPIPE '6' struct file * fileCreate(struct directory *parent, char *name, uint32_t nameLength, uint8_t *staticBuffer, uint32_t staticSize)
Creates a new kernel file object.
struct directory * fileSystemIsValidDirectory(struct object *obj)
Checks if a given object is of the type directory and casts it if possible.
struct tarHeader __attribute__((packed))
struct openedDirectory * directoryOpen(struct directory *directory)
Creates a new kernel openedDirectory object.
struct openedFile * fileOpen(struct file *file)
Creates a new kernel openedFile object.
struct file * fileSystemIsValidFile(struct object *obj)
Checks if a given object is of the type file and casts it if possible.
struct directory * parent
struct linkedList directories
void fileSystemInit(void *addr, uint32_t length)
Initializes the root file system.
struct directory * fileSystemSearchDirectory(struct directory *directory, char *path, uint32_t pathLength, bool create)
Opens or creates a directory.
struct linkedList openedDirectories
struct directory * directoryCreate(struct directory *parent, char *name, uint32_t nameLength)
Creates a new kernel directory object.
struct directory * parent
struct directory * fileSystemGetRoot()
Returns a reference to the root node of the file system.
struct file * fileSystemSearchFile(struct directory *directory, char *path, uint32_t pathLength, bool create)
Opens or creates a file.