How have you defined relPath, and what value does it contain? What is the purpose of the sleep? How do you exit if the file is not F_OK?
Also the above code is missing a closing brace before the while statement.
The following program works fine for me.
int fileExists = F_OK;
if((fileExists = access(relPath, F_OK)) != F_OK)
printf("Can't access file.\n");