mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 20:04:17 +01:00
Implement IFileSystem::CreateDirectory
This commit is contained in:
parent
a09414424b
commit
33c9731eca
@ -10,13 +10,19 @@ namespace skyline::service::fssrv {
|
||||
IFileSystem::IFileSystem(std::shared_ptr<vfs::FileSystem> backing, const DeviceState &state, ServiceManager &manager) : backing(std::move(backing)), BaseService(state, manager) {}
|
||||
|
||||
Result IFileSystem::CreateFile(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
std::string path(request.inputBuf.at(0).as_string(true));
|
||||
std::string path{request.inputBuf.at(0).as_string(true)};
|
||||
auto mode{request.Pop<u64>()};
|
||||
auto size{request.Pop<u32>()};
|
||||
|
||||
return backing->CreateFile(path, size) ? Result{} : result::PathDoesNotExist;
|
||||
}
|
||||
|
||||
Result IFileSystem::CreateDirectory(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
std::string path{request.inputBuf.at(0).as_string(true)};
|
||||
|
||||
return backing->CreateDirectory(path, true) ? Result{} : result::PathDoesNotExist;
|
||||
}
|
||||
|
||||
Result IFileSystem::GetEntryType(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
std::string path(request.inputBuf.at(0).as_string(true));
|
||||
|
||||
|
@ -23,6 +23,11 @@ namespace skyline::service::fssrv {
|
||||
*/
|
||||
Result CreateFile(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/**
|
||||
* @brief Creates a directory at the specified path in the filesystem
|
||||
*/
|
||||
Result CreateDirectory(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/**
|
||||
* @brief Queries the DirectoryEntryType of the given path
|
||||
* @url https://switchbrew.org/wiki/Filesystem_services#GetEntryType
|
||||
@ -48,6 +53,7 @@ namespace skyline::service::fssrv {
|
||||
|
||||
SERVICE_DECL(
|
||||
SFUNC(0x0, IFileSystem, CreateFile),
|
||||
SFUNC(0x2, IFileSystem, CreateDirectory),
|
||||
SFUNC(0x7, IFileSystem, GetEntryType),
|
||||
SFUNC(0x8, IFileSystem, OpenFile),
|
||||
SFUNC(0x9, IFileSystem, OpenDirectory),
|
||||
|
Loading…
Reference in New Issue
Block a user