From c09ef501e1baf293d92b166e5e38e29a41cf64c2 Mon Sep 17 00:00:00 2001 From: Lukas Oesch Date: Tue, 9 Jun 2026 11:06:25 +0200 Subject: implement mkdir and create function in kapi::filesystem that calls the vfs and then the underlying filesystem --- kapi/kapi/filesystem.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'kapi') diff --git a/kapi/kapi/filesystem.hpp b/kapi/kapi/filesystem.hpp index 5346a96d..1656a17f 100644 --- a/kapi/kapi/filesystem.hpp +++ b/kapi/kapi/filesystem.hpp @@ -1,6 +1,7 @@ #ifndef TEACHOS_KAPI_FILESYSTEM_HPP #define TEACHOS_KAPI_FILESYSTEM_HPP +#include #include #include @@ -69,6 +70,23 @@ namespace kapi::filesystem @qualifier kernel-defined */ auto write(size_t file_descriptor, void const * buffer, size_t size) -> std::expected; + + /** + @brief Creates a new directory at the specified @p path. + @param path The path where the new directory should be created. + @return 0 on success, -1 on failure. + @qualifier kernel-defined + */ + auto mkdir(std::string_view path) -> kstd::result; + + /** + @brief Creates a new file at the specified @p path. + @param path The path where the new file should be created. + @return 0 on success, -1 on failure. + @qualifier kernel-defined + */ + // TODO remove again after the open method supports an optional create flag + auto create(std::string_view path) -> kstd::result; } // namespace kapi::filesystem #endif // TEACHOS_KAPI_FILESYSTEM_HPP \ No newline at end of file -- cgit v1.2.3