How do I check to see if a file exists, then create on if it doesn't? I've been searching and trying different things to no avail. Is their a 'FileCreate' somewhere that I can use, or something like it?
Mark
How do I check to see if a file exists, then create on if it doesn't? I've been searching and trying different things to no avail. Is their a 'FileCreate' somewhere that I can use, or something like it?
Mark
Language: C++
Compiler: Borland C++
OS: Windows NT
if you are just going to create a file automatically if one doesn't exist just:
By default the OS will create a file if it does not find one, you'd actually have to add ios:: nocreate if you didn't want it to.Code:fstream myfile; myfile.open("File.txt",ios:: out|ios:: in);