30 lines
746 B
C++
30 lines
746 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> working_directory();
|
|
Result<String> home_directory();
|
|
|
|
Result<void> change_directory(StringView path);
|
|
}
|
|
}
|