mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
This commit is contained in:
commit
2d011e94cd
10 changed files with 172 additions and 104 deletions
|
@ -196,23 +196,35 @@ int cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
|
|||
{
|
||||
if(path.CmpNoCase(Emu.GetVFS().m_devices[i].GetPs3Path().RemoveLast(1)) == 0)
|
||||
{
|
||||
sys_fs.Log("cellFsFstat: '%s' is a mount point.", path.mb_str());
|
||||
sys_fs.Log("cellFsStat: '%s' is a mount point.", path.mb_str());
|
||||
sb->st_mode |= CELL_FS_S_IFDIR;
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
|
||||
vfsFile f(path);
|
||||
|
||||
if(!f.IsOpened())
|
||||
// TODO: Temporary solution until vfsDir is implemented
|
||||
wxString real_path;
|
||||
Emu.GetVFS().GetDevice(path, real_path);
|
||||
struct stat s;
|
||||
if(stat(real_path.c_str(), &s) == 0)
|
||||
{
|
||||
sys_fs.Warning("cellFsFstat: '%s' not found.", path.mb_str());
|
||||
if(s.st_mode & S_IFDIR)
|
||||
{
|
||||
sb->st_mode |= CELL_FS_S_IFDIR;
|
||||
}
|
||||
else if(s.st_mode & S_IFREG)
|
||||
{
|
||||
vfsFile f(path);
|
||||
sb->st_mode |= CELL_FS_S_IFREG;
|
||||
sb->st_size = f.GetSize();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_fs.Warning("cellFsStat: '%s' not found.", path.mb_str());
|
||||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
sb->st_mode |= CELL_FS_S_IFREG; //TODO: dir CELL_FS_S_IFDIR
|
||||
sb->st_size = f.GetSize();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue