title: Detecting reason for failure to open an ofstream when fail() is true
body: <p>Seems like this should be simple, but I don't find it in a net search.</p>
  
  <p>I have an ofstream which is <code>open()</code>, and <code>fail()</code> is now true. I'd like to know the reason for the failure to open, like with <code>errno</code> I would do <code>sys_errlist[errno]</code>.</p>