diff options
| author | Lukas Oesch <lukasoesch20@gmail.com> | 2026-06-09 11:06:25 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-14 22:08:22 +0200 |
| commit | c09ef501e1baf293d92b166e5e38e29a41cf64c2 (patch) | |
| tree | 113863fe2074f2ffb3666c58977ec461d488f9a5 /kapi | |
| parent | 8f4719cb75bc1be5198156d80c7be54f124a192c (diff) | |
| download | kernel-c09ef501e1baf293d92b166e5e38e29a41cf64c2.tar.xz kernel-c09ef501e1baf293d92b166e5e38e29a41cf64c2.zip | |
implement mkdir and create function in kapi::filesystem that calls the vfs and then the underlying filesystem
Diffstat (limited to 'kapi')
| -rw-r--r-- | kapi/kapi/filesystem.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
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 <kstd/result.hpp> #include <kstd/system_error.hpp> #include <cstddef> @@ -69,6 +70,23 @@ namespace kapi::filesystem @qualifier kernel-defined */ auto write(size_t file_descriptor, void const * buffer, size_t size) -> std::expected<std::size_t, kstd::error_code>; + + /** + @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<void>; + + /** + @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<void>; } // namespace kapi::filesystem #endif // TEACHOS_KAPI_FILESYSTEM_HPP
\ No newline at end of file |
