[c++] How to check if a file exists before creating a new file