I am implementing file saving functionality within a Qt application using C++.
I am looking for a way to check to see if the selected file already exists before writing to it, so that I can prompt a warning to the user.
I am using an std::ofstream and I am not looking for a Boost solution.
This is one of my favorite tuck-away functions I keep on hand for multiple uses.
I find this much more tasteful than trying to open a file if you have no immediate intentions of using it for I/O.