i'm acctually using the open function with option "std::ios::out | std::ios::app" to create file or append to it, but now i need to distinguish the case in which the file exists from the case in which the file doesn't exists. In fact, if the file doesn't exist, i have to create it and add to it an header (a string at the beginning), else i have to append content to the file.. How can i make this? i've read about the fstat function that returns -1 if errors occur. Buf if fstat returns -1, can i be sure the file doesn't exist?
Thanks