I used \'fopen\' in a C program to open a file in readonly mode (r). But in my case I observed that fopen call does not return. It does not return NULL or valid pointer - execut
I notice you don't close the file if you open it successfully.
Is it possible you that you have run it before and killed it, and now you have a process out there which has the file open, and locked?
If so, then maybe fopen is waiting for the lock to be released.