Luna/libos/include/os/FileSystem.h

30 lines
658 B
C
Raw Normal View History

2023-04-13 16:33:04 +00:00
#pragma once
2023-05-12 21:47:20 +00:00
#include <bits/struct_stat.h>
2023-04-13 16:33:04 +00:00
#include <luna/Result.h>
#include <luna/StringView.h>
#include <os/Path.h>
2023-04-13 16:33:04 +00:00
#include <sys/types.h>
namespace os
{
namespace FileSystem
{
bool exists(const Path& path);
2023-04-13 16:33:04 +00:00
bool is_directory(const Path& path);
2023-04-13 16:33:04 +00:00
2023-05-12 21:47:20 +00:00
Result<void> stat(const Path& path, struct stat& st);
2023-04-13 16:33:04 +00:00
Result<void> create_directory(StringView path, mode_t mode);
Result<void> remove(const Path& path);
Result<void> remove_tree(const Path& path);
2023-04-13 16:33:04 +00:00
Result<String> working_directory();
Result<String> home_directory();
2023-04-18 16:46:19 +00:00
Result<void> change_directory(StringView path);
2023-04-13 16:33:04 +00:00
}
}