mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-29 08:04:16 +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);
|
auto r = ::stat (convertedPath.c_str (), sbuf);
|
||||||
if (r < 0)
|
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))
|
if (sVirtualDirs.contains (convertedPath))
|
||||||
{
|
{
|
||||||
*sbuf = {};
|
*sbuf = {};
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <mocha/mocha.h>
|
#include <mocha/mocha.h>
|
||||||
#include <nn/ac.h>
|
#include <nn/ac.h>
|
||||||
|
#include <nn/act.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include <coreinit/thread.h>
|
#include <coreinit/thread.h>
|
||||||
@ -159,6 +160,8 @@ void start_server ()
|
|||||||
virtualDirsInRoot.emplace_back ("storage_usb");
|
virtualDirsInRoot.emplace_back ("storage_usb");
|
||||||
IOAbstraction::addVirtualPath ("storage_usb:/", {});
|
IOAbstraction::addVirtualPath ("storage_usb:/", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sMochaPathsWereMounted = true;
|
||||||
}
|
}
|
||||||
virtualDirsInRoot.emplace_back ("fs");
|
virtualDirsInRoot.emplace_back ("fs");
|
||||||
IOAbstraction::addVirtualPath (":/", virtualDirsInRoot);
|
IOAbstraction::addVirtualPath (":/", virtualDirsInRoot);
|
||||||
@ -167,7 +170,22 @@ void start_server ()
|
|||||||
"fs:/vol", std::vector<std::string>{"external01", "content", "save"});
|
"fs:/vol", std::vector<std::string>{"external01", "content", "save"});
|
||||||
|
|
||||||
IOAbstraction::addVirtualPath ("fs:/vol/content", {});
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user