Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
C++ if exist
Name: djas Date: February 3, 2005 at 15:09:53 Pacific OS: Windows XP Pro SP2 CPU/Ram: P4 2.40 GHZ 256 RAM
Comment:
Is there a command in c++ that works like the "if exist" command in command prompt. thanx
Name: sen (by santanusen_82) Date: February 6, 2005 at 21:19:42 Pacific
Reply:
Hello djas, I think u wanna check a file for existence, right? You can use the 'open' system call to check for existence of a file. For that you need to use the O_CREAT flag along with O_EXCL flag. If the file already exists, the open call will fail and return -1. Let's check this sample code....
Summary: It DOES ================ C:\temp>if exist *.bat echo y y ===================================== If at first you don't succeed, you're about average. M2 ...
Summary: Hi, I'm trying to do a batch file where need to do a For %%A in (1, 2, 3, 4, 5, 6) DO( if exisit "filename1" set var1= -par1 "filename" excecute programe with parameter.exe) but i couldn't seems to be...
Summary: I would like to have a batch file that looks for a file on a network drive, if it doesn't find it, it waits for 10 seconds or so, & looks for it again. I've seen batch files like this that use IF EXIS...