Recheck for a file that is missing.

Hello all,

I am building a program that utilizes many files located in the directory of the program. When going to open the file in question, the program checks to see if it is even there and if it isn't, it displays a dialog to the user stating that the file was not found. I was wondering if there were a way to recheck for the missing file after the dialog has been displayed (maybe after the user enters a keystroke or something). Basically something like this:

*Program checks for file
*File is missing
*Displays to the user that the file is missing
*Waits for user keystroke to signal the file is now there
*Rechecks for expected file

(At the "Waits for user keystroke to signal the file is now there" it could also have two options: [Enter] for recheck and [Esc] for exit the program.)

Does anyone know of a way to do this? Below is the code I have so far:

1
2
3
4
if ((fpx = fopen("IRZIxvalue1.txt", "r")) == NULL)	
	{
		printf("IRZIxvalue1.txt could not be found. Make sure it is located in your application folder.\n");
	}


Thank you for your help.

-Billy-
Use a while loop instead of an if statement. The waiting for keystroke shouldn't be too hard.
Topic archived. No new replies allowed.