mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-25 14:16:55 +01:00
Fix accessing the /vol/save directories
This commit is contained in:
parent
3e1d862aff
commit
ec1101e82f
@ -183,6 +183,18 @@ int IOAbstraction::stat (const char *path, struct stat *sbuf)
|
||||
auto r = ::stat (convertedPath.c_str (), sbuf);
|
||||
if (r < 0)
|
||||
{
|
||||
if (errno == EPERM)
|
||||
{
|
||||
auto *dir = ::opendir (convertedPath.c_str ());
|
||||
if (dir)
|
||||
{
|
||||
*sbuf = {};
|
||||
// TODO: init other values?
|
||||
sbuf->st_mode = _IFDIR;
|
||||
::closedir (dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (sVirtualDirs.contains (convertedPath))
|
||||
{
|
||||
*sbuf = {};
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <mocha/mocha.h>
|
||||
#include <nn/ac.h>
|
||||
#include <nn/act.h>
|
||||
#include <thread>
|
||||
|
||||
#include <coreinit/thread.h>
|
||||
@ -159,6 +160,8 @@ void start_server ()
|
||||
virtualDirsInRoot.emplace_back ("storage_usb");
|
||||
IOAbstraction::addVirtualPath ("storage_usb:/", {});
|
||||
}
|
||||
|
||||
sMochaPathsWereMounted = true;
|
||||
}
|
||||
virtualDirsInRoot.emplace_back ("fs");
|
||||
IOAbstraction::addVirtualPath (":/", virtualDirsInRoot);
|
||||
@ -167,7 +170,22 @@ void start_server ()
|
||||
"fs:/vol", std::vector<std::string>{"external01", "content", "save"});
|
||||
|
||||
IOAbstraction::addVirtualPath ("fs:/vol/content", {});
|
||||
sMochaPathsWereMounted = true;
|
||||
|
||||
std::vector<std::string> virtualDirsInSave;
|
||||
virtualDirsInSave.emplace_back ("common");
|
||||
nn::act::Initialize ();
|
||||
for (int32_t i = 0; i < 13; i++)
|
||||
{
|
||||
if (!nn::act::IsSlotOccupied (i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
char buffer[9];
|
||||
snprintf (buffer, sizeof (buffer), "%08X", nn::act::GetPersistentIdEx (i));
|
||||
virtualDirsInSave.emplace_back (buffer);
|
||||
}
|
||||
nn::act::Finalize ();
|
||||
IOAbstraction::addVirtualPath ("fs:/vol/save", virtualDirsInSave);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user