<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ifstream fehlerbehanldung]]></title><description><![CDATA[<p>hallo,<br />
hätte eine kleine frage:</p>
<p>wie macht man bei mit ifstream bei anglegen eines streams eine richtige Fehlerbehandlung ( etwa wenn die angegebene datei nicht existiert ) ?</p>
<pre><code class="language-cpp">ifstream file(filename, std::ios::binary | std::ios::in);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/238878/ifstream-fehlerbehanldung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 17:35:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/238878.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Apr 2009 21:25:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ifstream fehlerbehanldung on Thu, 16 Apr 2009 21:25:53 GMT]]></title><description><![CDATA[<p>hallo,<br />
hätte eine kleine frage:</p>
<p>wie macht man bei mit ifstream bei anglegen eines streams eine richtige Fehlerbehandlung ( etwa wenn die angegebene datei nicht existiert ) ?</p>
<pre><code class="language-cpp">ifstream file(filename, std::ios::binary | std::ios::in);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1696930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696930</guid><dc:creator><![CDATA[agus]]></dc:creator><pubDate>Thu, 16 Apr 2009 21:25:53 GMT</pubDate></item><item><title><![CDATA[Reply to ifstream fehlerbehanldung on Thu, 16 Apr 2009 22:49:02 GMT]]></title><description><![CDATA[<p>Indem man die Fehlerflags abfragt. Die C++-Streams besitzen interne Flags, anhand denen man den Status des Objekts abfragen kann. Zum Beispiel sagt die Memberfunktion <code>good()</code> , ob alles okay ist. Wenn du nur sehen willst, ob eine Datei geöffnet ist, kannst du <code>is_open()</code> verwenden.</p>
<p>Eine Übersicht über <code>std::ifstream</code> findest du hier:<br />
<a href="http://www.cplusplus.com/reference/iostream/ifstream/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ifstream/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1696960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1696960</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 16 Apr 2009 22:49:02 GMT</pubDate></item><item><title><![CDATA[Reply to ifstream fehlerbehanldung on Fri, 17 Apr 2009 13:09:51 GMT]]></title><description><![CDATA[<p>Erwähnenswert wäre vielleicht noch das hier gewesen:<br />
<a href="http://www.cplusplus.com/reference/iostream/ios/exceptions/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ios/exceptions/</a></p>
<p>Ein Fehler, im Sinne von &quot;Datei existiert nicht&quot;, gibt es allerdings bei den Streams nicht. Es gibt nur sehr allgemeine Fehler, wie &quot;Kann nicht geöffnet werden&quot;. Falls du prüfen willst, ob die Datei existiert, dann musst du dies über eine entsprechende API machen. Boost hätte da zum Beispiel Boost.Filesystem anzubieten.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1697253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1697253</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Fri, 17 Apr 2009 13:09:51 GMT</pubDate></item></channel></rss>