Skip to content

Commit

Permalink
improve file IO
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 6, 2023
1 parent a258b45 commit be42a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions extras/menus/arkMenu/src/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,21 +521,27 @@ void Browser::refreshDirs(){
continue;
}

string ptmp = string(this->cwd)+string(dit->d_name);
string ptmp;
if (FIO_SO_ISDIR(dit->d_stat.st_attr)){
printf("is dir\n");
if (!common::folderExists(ptmp+"/")){
if (strlen(dit->d_name) < strlen((char*)pri_dirent)){
ptmp = string(this->cwd) + string((const char*)pri_dirent);
printf("%d: %s\n", (int)common::folderExists(ptmp), ptmp.c_str());
}
else{
ptmp = string(this->cwd)+string(dit->d_name);
}
folders.push_back(new Folder(ptmp+"/"));
}
else{
printf("is file\n");
if (!common::fileExists(ptmp)){
if (strlen(dit->d_name) < strlen((char*)pri_dirent)){
ptmp = string(this->cwd) + string((const char*)pri_dirent);
printf("%d: %s\n", (int)common::fileExists(ptmp), ptmp.c_str());
}
else{
ptmp = string(this->cwd)+string(dit->d_name);
}
files.push_back(new File(ptmp));
}

Expand Down
2 changes: 1 addition & 1 deletion extras/menus/arkMenu/src/gamemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void GameManager::findISOs(const char* path){
}
continue;
}
else if (!common::fileExists(fullpath)){
else if (strlen(dit->d_name) < strlen((char*)pri_dirent)){
fullpath = string(path) + string((const char*)pri_dirent);
}
if (Iso::isISO(fullpath.c_str())) this->categories[GAME]->addEntry(new Iso(fullpath));
Expand Down

0 comments on commit be42a64

Please sign in to comment.