mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(PS4/ORBIS) Move path_is_directory code parts to VFS layer - hope I did
it right
This commit is contained in:
parent
f117d763d6
commit
32f9b9ab9a
@ -78,11 +78,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(ORBIS)
|
||||
#include <orbisFile.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/dirent.h>
|
||||
#endif
|
||||
#if defined(PSP)
|
||||
#include <pspkernel.h>
|
||||
#endif
|
||||
@ -156,19 +151,7 @@ int path_stat(const char *path)
|
||||
*/
|
||||
bool path_is_directory(const char *path)
|
||||
{
|
||||
#ifdef ORBIS
|
||||
/* TODO: This should be moved to the VFS module */
|
||||
int dfd;
|
||||
if (!path)
|
||||
return false;
|
||||
dfd = orbisDopen(path);
|
||||
if (dfd < 0)
|
||||
return false;
|
||||
orbisDclose(dfd);
|
||||
return true;
|
||||
#else
|
||||
return (path_stat_internal(path, NULL) & RETRO_VFS_STAT_IS_DIRECTORY) != 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool path_is_character_special(const char *path)
|
||||
|
@ -62,6 +62,7 @@
|
||||
# include <unistd.h>
|
||||
# if defined(ORBIS)
|
||||
# include <sys/fcntl.h>
|
||||
# include <sys/dirent.h>
|
||||
# include <orbisFile.h>
|
||||
# endif
|
||||
#endif
|
||||
@ -788,9 +789,6 @@ const char *retro_vfs_file_get_path_impl(libretro_vfs_implementation_file *strea
|
||||
int retro_vfs_stat_impl(const char *path, int32_t *size)
|
||||
{
|
||||
bool is_dir, is_character_special;
|
||||
#if defined(ORBIS)
|
||||
return 0; /* for now */
|
||||
#endif
|
||||
#if defined(VITA) || defined(PSP)
|
||||
SceIoStat buf;
|
||||
int stat_ret;
|
||||
@ -803,6 +801,8 @@ int retro_vfs_stat_impl(const char *path, int32_t *size)
|
||||
free(tmp);
|
||||
if (stat_ret < 0)
|
||||
return 0;
|
||||
#elif defined(ORBIS)
|
||||
int dir_ret;
|
||||
#elif defined(PS2)
|
||||
iox_stat_t buf;
|
||||
char *tmp = strdup(path);
|
||||
@ -864,6 +864,10 @@ int retro_vfs_stat_impl(const char *path, int32_t *size)
|
||||
|
||||
#if defined(VITA) || defined(PSP)
|
||||
is_dir = FIO_S_ISDIR(buf.st_mode);
|
||||
#elif defined(ORBIS)
|
||||
dir_ret = orbisDopen(path);
|
||||
is_dir = dir_ret > 0;
|
||||
orbisDclose(dfd);
|
||||
#elif defined(PS2)
|
||||
if (!buf.mode)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user