I'm opening a file using fstream and writing into the file. While write is in process if want to recreate if the file is deleted by some one. Can any one help me in how to do this.
Re-open the file for every write. This will guarantee that the file is recreated if it is deleted. Otherwise, use a logging tool such as log4cxx and let it handle all this for you. http://logging.apache.org/log4cxx/index.html