<?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 überprüfen]]></title><description><![CDATA[<p>Hallo!<br />
Ein einem meiner Programme, habe ich vor, zu überprüfen, ob eine bestimmte Datei vohanden ist.<br />
So funktioniert es nicht:</p>
<pre><code>try
{
Memo1-&gt;Lines-&gt;LoadFromFile(&quot;C:\\datei1.txt&quot;);
}
catch(...)
{
Application-&gt;MessageBox (&quot;Datei nicht gefunden!&quot;, &quot;&quot;);
}
</code></pre>
<p>Aber wie kann ich sonst das Existieren einer bestimmten Datei überprüfen?</p>
<p>Danke,<br />
Was_weiß_ich_?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237264/datei-überprüfen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 12:37:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237264.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Mar 2009 13:59:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei überprüfen on Thu, 26 Mar 2009 13:59:55 GMT]]></title><description><![CDATA[<p>Hallo!<br />
Ein einem meiner Programme, habe ich vor, zu überprüfen, ob eine bestimmte Datei vohanden ist.<br />
So funktioniert es nicht:</p>
<pre><code>try
{
Memo1-&gt;Lines-&gt;LoadFromFile(&quot;C:\\datei1.txt&quot;);
}
catch(...)
{
Application-&gt;MessageBox (&quot;Datei nicht gefunden!&quot;, &quot;&quot;);
}
</code></pre>
<p>Aber wie kann ich sonst das Existieren einer bestimmten Datei überprüfen?</p>
<p>Danke,<br />
Was_weiß_ich_?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686351</guid><dc:creator><![CDATA[Was_weiß_ich_?]]></dc:creator><pubDate>Thu, 26 Mar 2009 13:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Thu, 26 Mar 2009 14:07:14 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::ifstream stream (&quot;C:/bla.txt&quot;);
if (stream)
 //alles klar
else
 //gibts nich
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686357</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 26 Mar 2009 14:07:14 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Thu, 26 Mar 2009 14:59:15 GMT]]></title><description><![CDATA[<p>Da er den BCB verwendet würde auch das hier gehen.</p>
<pre><code class="language-cpp">if( !FileExists(&quot;C:\\datei1.txt&quot;))
{
    Application-&gt;MessageBox (&quot;Datei nicht gefunden!&quot;, &quot;&quot;);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1686394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686394</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 26 Mar 2009 14:59:15 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 13:36:09 GMT]]></title><description><![CDATA[<p>Ok,<br />
ich hätte aber gerne, dass, wenn die Datei nicht existstiert ein anderes Formaular gezeigt wird:</p>
<pre><code>if( !FileExists(&quot;C:\\datei1.txt&quot;))
        {
        Form2-&gt;ShowModal();
        }
</code></pre>
<p>Doch da kommt folgende Fehlermeldung:</p>
<blockquote>
<p>Im Pfojekt Project1.exe ist eine Exception der Klasse EAccessViolation aufgetreten. Meldung:'Zugriffsverletzung bei Adresse 00401D84 in Modul 'Project1.exe'. Lesen von Adresse 000000000'. Prozess wurde angelhalten. Mit einzelne Anweisung oder Start fortsetzten.</p>
</blockquote>
<p>Weiß jemand warum?</p>
<p>Danke,<br />
Was_weiß_ich_?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686951</guid><dc:creator><![CDATA[Was_weiß_ich_?]]></dc:creator><pubDate>Fri, 27 Mar 2009 13:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 13:45:13 GMT]]></title><description><![CDATA[<p>Geh mit dem Debugger durch und schau nach ob Form2 schon existiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686957</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 27 Mar 2009 13:45:13 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 15:03:53 GMT]]></title><description><![CDATA[<p>Form2 existiert sicher.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687013</guid><dc:creator><![CDATA[Was_weiß_ich_?]]></dc:creator><pubDate>Fri, 27 Mar 2009 15:03:53 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 15:05:39 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">// exists oder file_exists, bin grade net sicher ;)
if ( boost::filesystem::exists(file) )
{
}
</code></pre>
<p>rya.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687014</guid><dc:creator><![CDATA[scorcher24 | off]]></dc:creator><pubDate>Fri, 27 Mar 2009 15:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 15:08:59 GMT]]></title><description><![CDATA[<p>Was_weiß_ich_? schrieb:</p>
<blockquote>
<p>Form2 existiert sicher.</p>
</blockquote>
<p>Bist du mit dem Debugger durchgegangen um den Fehler einzugrenzen? Hast du die Variablen überprüft?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687017</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 27 Mar 2009 15:08:59 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 15:13:21 GMT]]></title><description><![CDATA[<p>scorcher24 | off schrieb:</p>
<blockquote>
<pre><code class="language-cpp">// exists oder file_exists, bin grade net sicher ;)
if ( boost::filesystem::exists(file) )
{
}
</code></pre>
<p>rya.</p>
</blockquote>
<p>exists ist schon richtig. Wobei hier file vom Typ boost::filesystem::path sein muss. Da er den BCB verwendet sollte er eine ältere boost-Version (1.34 oder so) nehmen da die BCB-Compiler mit den neuren versionen so ihre Probleme haben. Allerdings ist beim BCB2009 boost 1.35 dabei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687018</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 27 Mar 2009 15:13:21 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 16:22:37 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>Wobei hier file vom Typ boost::filesystem::path</p>
</blockquote>
<p>Nicht zwingend, denn der Konstruktor von <code>boost::filesystem::path</code> , welcher einen <code>std::string</code> annimmt, ist implizit. Somit kann man auch direkt einen <code>std::string</code> übergeben oder sogar ein String-Literal. Letzteres wird dann zuerst in ein <code>std::string</code> umgewandelt und dann in ein <code>boost::filesystem::path</code> .</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687048</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Fri, 27 Mar 2009 16:22:37 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 17:15:22 GMT]]></title><description><![CDATA[<p>War das schon immer so?<br />
Ich kann mich erinnern, dass das bei 1.33 und 1.34 bei mir nicht ging. Es kann natürlich auch an meinem Compiler gelegen haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687078</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 27 Mar 2009 17:15:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei überprüfen on Fri, 27 Mar 2009 18:04:18 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>War das schon immer so?<br />
Ich kann mich erinnern, dass das bei 1.33 und 1.34 bei mir nicht ging. Es kann natürlich auch an meinem Compiler gelegen haben.</p>
</blockquote>
<p>Jedenfalls ganz sicher seit 1.34:<br />
<a href="http://www.boost.org/doc/libs/1_34_0/libs/filesystem/doc/tr2_proposal.html#basic_path-requirements" rel="nofollow">http://www.boost.org/doc/libs/1_34_0/libs/filesystem/doc/tr2_proposal.html#basic_path-requirements</a></p>
<p>Und da seh ich auch noch, dass ich eine Unwahrheit gesagt habe. <code>boost::filesystem::path</code> hat sogar einen impliziten Konstruktor für <code>char const*</code> . <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Vor 1.33 kann ich nichts sagen, da ich da noch nicht mit Boost gearbeitet habe und die Referenz reicht auch nicht so weit zurück. Wenn man sich allerdings die &quot;Change History&quot; anschaut, so findet man unter 1.34 die &quot;Simplification of the path interface&quot;. Wenn ich das richtig verstehe, waren vorher zwei Argumente nötig, um ein <code>path</code> Objekt zu erstellen. Da wäre natürlich eine impliziter Konstruktor schlecht möglich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687102</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687102</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Fri, 27 Mar 2009 18:04:18 GMT</pubDate></item></channel></rss>