check my code ( if statement, file existance )
You can read through this if you want.......I just took >NUL of the system statement and the file im trying to open is denied for access. Im leaving it open somewhere before I execute it.......I wanna try to figure it out, if i can't, help me then.....
Someone on here showed how to check for file existance. I'm checking for the existance of 2 files at once, in one straight sweep. Here's the code...
Now when I put this program into the folder where these files are clearly located ( and work from the command promt ). I can type arcade 1941 >NUL from the comand prompt and it works just fine. For some reason this program is skipping the system command in this program. IT IS printing the printf statement right before it though.....HU?
/* FILE * Tmp; - I found I dont need this */
/* Check for arcade.exe */
if(fopen("d:\\arcade.exe", "r+") == 0)
/* If arcade.exe wasn't found */
printf("\nArcade.exe was not found!");
/* Arcade.exe was found, check for secondary file 1941.zip*/
if(fopen("d:\\1941.zip", "r+") == 0)
/* If 1941.zip wasn't found */
printf("\n1941.zip not found!");
/* Load 1941.zip through arcade.exe */
system("arcade 1941 >NUL");
side note ( a few sec later ):
I can get all of the messages. I just move the file it's looking for into a different directory and it displays the proper messages stating that the certain files that are needed weren't found. I can't get that dang system command to execute though? Everything else works fine...
I replaced the arcade.exe 1941 system call with c:\\windows\\write.exe and that works! The only reason it's just arcade.exe with no path is because im running this program from the directory arcade.exe is in. Arcade.exe then does more extensive searching for the secondary file.