<?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[Datei finden und C++]]></title><description><![CDATA[<p>Hi,</p>
<p>wenn ich prüfe, ob eine bestimmte Datei(m_strPath) vorhanden ist, schreibe ich folgenden Kode:</p>
<pre><code class="language-cpp">// Pfad prüfen
FILE* dummy = NULL;
dummy = fopen(m_strPath.c_str(), &quot;r&quot;);
if (dummy==NULL)	return false;
else				fclose(dummy);
</code></pre>
<p>Ist der Kode noch ordentliches C++, oder wie programmiert man das in C++?</p>
<p>Grüsse,<br />
don_basto</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/123889/datei-finden-und-c</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 19:20:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123889.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Oct 2005 07:39:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei finden und C++ on Fri, 21 Oct 2005 07:39:02 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>wenn ich prüfe, ob eine bestimmte Datei(m_strPath) vorhanden ist, schreibe ich folgenden Kode:</p>
<pre><code class="language-cpp">// Pfad prüfen
FILE* dummy = NULL;
dummy = fopen(m_strPath.c_str(), &quot;r&quot;);
if (dummy==NULL)	return false;
else				fclose(dummy);
</code></pre>
<p>Ist der Kode noch ordentliches C++, oder wie programmiert man das in C++?</p>
<p>Grüsse,<br />
don_basto</p>
]]></description><link>https://www.c-plusplus.net/forum/post/897393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/897393</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Fri, 21 Oct 2005 07:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Datei finden und C++ on Fri, 21 Oct 2005 07:40:19 GMT]]></title><description><![CDATA[<p>Mit std::ifstream natürlich. Aber das Öffnen der Datei kann auch fehlschlagen wenn die Datei existiert. Ist zwar unwahrscheinlich, kann aber passieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/897396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/897396</guid><dc:creator><![CDATA[..................]]></dc:creator><pubDate>Fri, 21 Oct 2005 07:40:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei finden und C++ on Fri, 21 Oct 2005 07:50:57 GMT]]></title><description><![CDATA[<p>so unwahrscheinlich nun auch nicht. Es muss &quot;nur&quot; z.B. ein andere Prozess die Datei mit exklusiven Rechten geöffnet haben, schon schlägts fehlt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/897409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/897409</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Fri, 21 Oct 2005 07:50:57 GMT</pubDate></item><item><title><![CDATA[Reply to Datei finden und C++ on Fri, 21 Oct 2005 14:37:49 GMT]]></title><description><![CDATA[<p>don_basto schrieb:</p>
<blockquote>
<p>Ist der Kode noch ordentliches C++, oder wie programmiert man das in C++?</p>
</blockquote>
<p>mit boost::filesystem =&gt; exists()</p>
<p>das kann nämlich nicht nur fehlschlagen, wenn die datei schon geöffnet ist, sondern auch, wenn du kein leserecht hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/897871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/897871</guid><dc:creator><![CDATA[terraner]]></dc:creator><pubDate>Fri, 21 Oct 2005 14:37:49 GMT</pubDate></item><item><title><![CDATA[Reply to Datei finden und C++ on Fri, 21 Oct 2005 15:36:37 GMT]]></title><description><![CDATA[<p>Also FILE ist ja erstmal C und nicht C++. fstream ist schon besser, sagt aber nichts aus. Benutzt doch mal eine vernünftige Dateisystem Library:</p>
<p><a href="http://www.boost.org/libs/filesystem/doc/index.htm" rel="nofollow">boost::filesystem</a></p>
<p><a href="http://www.boost.org/libs/filesystem/doc/operations.htm#exists" rel="nofollow">boost::filesystem::exists( const path &amp; ph )</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/897978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/897978</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Fri, 21 Oct 2005 15:36:37 GMT</pubDate></item></channel></rss>