mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Implemented sys_fs_mount() and sys_fs_unmount()
This commit is contained in:
parent
5210df6882
commit
61a371b106
6 changed files with 126 additions and 18 deletions
|
|
@ -33,7 +33,7 @@ struct vfs_manager
|
|||
vfs_directory root{};
|
||||
};
|
||||
|
||||
bool vfs::mount(std::string_view vpath, std::string_view path)
|
||||
bool vfs::mount(std::string_view vpath, std::string_view path, bool create_dir)
|
||||
{
|
||||
if (vpath.empty())
|
||||
{
|
||||
|
|
@ -42,6 +42,12 @@ bool vfs::mount(std::string_view vpath, std::string_view path)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (create_dir && !fs::is_dir(std::string(path)) && !fs::create_dir(std::string(path)))
|
||||
{
|
||||
vfs_log.error("Cannot create directory \"%s\"", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Workaround
|
||||
g_fxo->need<vfs_manager>();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue