We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2bb1ce5 + 3c3006e commit 15af9a1Copy full SHA for 15af9a1
1 file changed
src/dmdevfs.c
@@ -964,7 +964,21 @@ static int unconfigure_drivers(dmfsi_context_t ctx)
964
*/
965
static bool is_file(const char* path)
966
{
967
- return Dmod_Access(path, DMOD_F_OK) == 0;
+ // Check if path exists
968
+ if (Dmod_Access(path, DMOD_F_OK) != 0)
969
+ {
970
+ return false;
971
+ }
972
+
973
+ // Try to open as directory - if it succeeds, it's a directory, not a file
974
+ void* dir_handle = Dmod_OpenDir(path);
975
+ if (dir_handle != NULL)
976
977
+ Dmod_CloseDir(dir_handle);
978
+ return false; // It's a directory
979
980
981
+ return true; // It's a file
982
}
983
984
/**
0 commit comments