This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi, note that the code works 99% of the time. But generated lot of segmentation faults during a overload scenario. So we are trying to add a data to a file and close it. After adding the data. We are flushing it and then closing it, not checking if it is open. It looks something like this, if (file.is_open) ... file << data; File.flush() File.close()
Where file is ofstream object. The segmentation comes at close. Is there a reason why so? The data is fine and was working with no problem durinf the normal scenarios. Looks like this is due to the overload situation. Any help?.
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp_questio...