3DSident/source/fs.c
Joel b288fd5093 Merge upstream changes
Decided to remove config info, and keep 3DSident (original) minimal and only display cruical information.

GSPLCD header is no longer required now that it's been merged into ctrulib

Screenshots are now in the same format as 3DShell.

All file handling functions use FS:USER
2017-07-15 02:00:34 -04:00

59 lines
999 B
C

#include "fs.h"
void openArchive(FS_ArchiveID id)
{
FSUSER_OpenArchive(&fsArchive, id, fsMakePath(PATH_EMPTY, ""));
}
void closeArchive(void)
{
FSUSER_CloseArchive(fsArchive);
}
Result makeDir(FS_Archive archive, const char * path)
{
if((!archive) || (!path))
return -1;
return FSUSER_CreateDirectory(archive, fsMakePath(PATH_ASCII, path), 0);
}
bool fileExists(FS_Archive archive, const char * path)
{
if((!path) || (!archive))
return false;
Handle handle;
Result ret = FSUSER_OpenFile(&handle, archive, fsMakePath(PATH_ASCII, path), FS_OPEN_READ, 0);
if(ret != 0)
return false;
ret = FSFILE_Close(handle);
if(ret != 0)
return false;
return true;
}
bool dirExists(FS_Archive archive, const char * path)
{
if((!path) || (!archive))
return false;
Handle handle;
Result ret = FSUSER_OpenDirectory(&handle, archive, fsMakePath(PATH_ASCII, path));
if(ret != 0)
return false;
ret = FSDIR_Close(handle);
if(ret != 0)
return false;
return true;
}