mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-10 07:14:21 +00:00
sys_fs_open: support split files
This commit is contained in:
parent
441541a42f
commit
62f9a2dc4b
@ -282,6 +282,29 @@ error_code sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode
|
||||
|
||||
fs::file file(local_path, open_mode);
|
||||
|
||||
if (!file && open_mode == fs::read && fs::g_tls_error == fs::error::noent)
|
||||
{
|
||||
// Try to gather split file (TODO)
|
||||
std::vector<fs::file> fragments;
|
||||
|
||||
for (u32 i = 66600; i <= 66699; i++)
|
||||
{
|
||||
if (fs::file fragment{fmt::format("%s.%u", local_path, i)})
|
||||
{
|
||||
fragments.emplace_back(std::move(fragment));
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fragments.empty())
|
||||
{
|
||||
file = fs::make_gather(std::move(fragments));
|
||||
}
|
||||
}
|
||||
|
||||
if (!file)
|
||||
{
|
||||
if (test(open_mode & fs::excl) && fs::g_tls_error == fs::error::exist)
|
||||
|
Loading…
x
Reference in New Issue
Block a user