mirror of
https://github.com/joel16/3DSident.git
synced 2024-11-23 03:29:45 +00:00
b288fd5093
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
59 lines
999 B
C
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;
|
|
} |