Luna/libos/include/os/FileSystem.h
apio 1a6ad11462
All checks were successful
continuous-integration/drone/push Build is passing
kernel+libc+libos+ls: Add readlink()
2023-05-23 15:42:38 +02:00

32 lines
798 B
C++

#pragma once
#include <bits/struct_stat.h>
#include <luna/Result.h>
#include <luna/StringView.h>
#include <os/Path.h>
#include <sys/types.h>
namespace os
{
namespace FileSystem
{
bool exists(const Path& path, bool follow_symlinks = true);
bool is_directory(const Path& path, bool follow_symlinks = false);
Result<void> stat(const Path& path, struct stat& st, bool follow_symlinks = true);
Result<void> create_directory(StringView path, mode_t mode);
Result<void> remove(const Path& path);
Result<void> remove_tree(const Path& path);
Result<String> readlink(const Path& path);
Result<String> working_directory();
Result<String> home_directory();
Result<void> change_directory(StringView path);
}
}