-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More similarity towards PSPident :p
- Loading branch information
Showing
6 changed files
with
380 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "fs.h" | ||
|
||
void openSdArchive() | ||
{ | ||
FSUSER_OpenArchive(&sdmcArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, "")); | ||
} | ||
|
||
void closeSdArchive() | ||
{ | ||
FSUSER_CloseArchive(sdmcArchive); | ||
} | ||
|
||
int makeDir(const char *path) | ||
{ | ||
if (!path) | ||
return -1; | ||
|
||
return mkdir(path, 0777); | ||
} | ||
|
||
bool fileExists(char *path) | ||
{ | ||
FILE * temp = fopen(path, "r"); | ||
if(temp == NULL) | ||
return false; | ||
|
||
fclose(temp); | ||
|
||
return true; | ||
} | ||
|
||
bool dirExists(const char *path) | ||
{ | ||
struct stat info; | ||
|
||
if(stat( path, &info ) != 0) | ||
return false; | ||
else if(info.st_mode & S_IFDIR) | ||
return true; | ||
else | ||
return false; | ||
} | ||
|
||
bool deleteFile(const char *path) | ||
{ | ||
openSdArchive(); | ||
Result ret = FSUSER_DeleteFile(sdmcArchive, fsMakePath(PATH_ASCII, path)); | ||
closeSdArchive(); | ||
return ret == 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <3ds.h> | ||
#include <stdbool.h> | ||
#include <stdio.h> | ||
#include <sys/stat.h> | ||
|
||
FS_Archive sdmcArchive; | ||
|
||
void openSdArchive(); | ||
void closeSdArchive(); | ||
int makeDir(const char * path); | ||
bool fileExists(char * path); | ||
bool dirExists(const char * path); | ||
bool deleteFile(const char *path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.