Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/dmdevfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,21 @@ static int unconfigure_drivers(dmfsi_context_t ctx)
*/
static bool is_file(const char* path)
{
return Dmod_Access(path, DMOD_F_OK) == 0;
// Check if path exists
if (Dmod_Access(path, DMOD_F_OK) != 0)
{
return false;
}

// Try to open as directory - if it succeeds, it's a directory, not a file
void* dir_handle = Dmod_OpenDir(path);
if (dir_handle != NULL)
{
Dmod_CloseDir(dir_handle);
return false; // It's a directory
}

return true; // It's a file
}

/**
Expand Down