Introduce plat_file_check and use it for ROM existence checking

This commit is contained in:
Cacodemon345
2025-09-20 00:30:29 +06:00
parent 9cdb597760
commit fdbf4a066b
4 changed files with 59 additions and 9 deletions

View File

@@ -412,6 +412,16 @@ plat_dir_check(char *path)
return S_ISDIR(dummy.st_mode);
}
int
plat_file_check(const char *path)
{
struct stat dummy;
if (stat(path, &dummy) < 0) {
return 0;
}
return !S_ISDIR(dummy.st_mode);
}
int
plat_dir_create(char *path)
{