Added CreateDirectory function to service/fs.cpp, and in Archive.
This commit is contained in:
parent
2ca12e7f38
commit
04c90c395d
8 changed files with 103 additions and 4 deletions
|
@ -380,6 +380,21 @@ Handle OpenFileFromArchive(Handle archive_handle, const std::string& path, const
|
|||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Directory from an Archive
|
||||
* @param archive_handle Handle to an open Archive object
|
||||
* @param path Path to the Directory inside of the Archive
|
||||
* @return Opened Directory object
|
||||
*/
|
||||
Result CreateDirectoryFromArchive(Handle archive_handle, const std::string& path) {
|
||||
Archive* archive = Kernel::g_object_pool.GetFast<Archive>(archive_handle);
|
||||
if (archive == nullptr)
|
||||
return -1;
|
||||
if (archive->backend->CreateDirectory(path))
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a Directory from an Archive
|
||||
* @param archive_handle Handle to an open Archive object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue