<?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[Alle Dateien in einem Verzeichnis löschen]]></title><description><![CDATA[<p>Hallo,</p>
<p>gibt es eine Funktion mit der man alle Dateien in einem Verzeichnis löschen kann ?</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/54188/alle-dateien-in-einem-verzeichnis-löschen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 15:50:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/54188.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Nov 2003 10:27:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Alle Dateien in einem Verzeichnis löschen on Wed, 05 Nov 2003 10:27:44 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>gibt es eine Funktion mit der man alle Dateien in einem Verzeichnis löschen kann ?</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/387058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387058</guid><dc:creator><![CDATA[JackTheR]]></dc:creator><pubDate>Wed, 05 Nov 2003 10:27:44 GMT</pubDate></item><item><title><![CDATA[Reply to Alle Dateien in einem Verzeichnis löschen on Wed, 05 Nov 2003 13:36:59 GMT]]></title><description><![CDATA[<p>Hilft dir das ?<br />
<a href="http://www.codeguru.com/forum/showthread.php?s=&amp;threadid=239271" rel="nofollow">http://www.codeguru.com/forum/showthread.php?s=&amp;threadid=239271</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/387225</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387225</guid><dc:creator><![CDATA[CrazyOwl]]></dc:creator><pubDate>Wed, 05 Nov 2003 13:36:59 GMT</pubDate></item><item><title><![CDATA[Reply to Alle Dateien in einem Verzeichnis löschen on Thu, 06 Nov 2003 08:37:36 GMT]]></title><description><![CDATA[<p>probier mal das hier. Beispiel für das Löschen aller temporären Druckerfiles (z.B. prnt001.tmp - prnt006.tmp).<br />
Das Beispiel funzt.</p>
<p>Gruß</p>
<pre><code class="language-cpp">BOOL CLVErrSimDlg::DeleteAllFiles()
{
	CFile del;
	CFileFind find;
	CString strFilePath, strCounter;
	int i = 1;
	BOOL findStatus = 0;
	BOOL bBrFlg = 0;

	// erstes temporäres File im Temp Ordner suchen
	CString strFirstFile;
	strFirstFile.Format(&quot;%d&quot;, i);
	strCounter = &quot;00&quot;+strFirstFile;
	strFilePath = m_strPathTemp+&quot;\\prnt&quot;+strCounter+&quot;.tmp&quot;;

	try
	{
		findStatus = find.FindFile(strFilePath);				// esrtes temporäres File finden
		del.Remove(strFilePath);
		i++;
	}

	catch(CException* e)
	{
		e-&gt;ReportError();
		e-&gt;Delete();
		return 0;
	}

	// folgende temporäre Files suchen und löschen
	do
	{
		strCounter.Format(&quot;%d&quot;, i);

		if(i &lt; 10)
			strCounter = &quot;00&quot;+strCounter;
		if((i &gt;= 10) &amp;&amp; (i &lt; 100))
			strCounter = &quot;0&quot;+strCounter;

		// das zu löschende File
		strFilePath = m_strPathTemp+&quot;\\prnt&quot;+strCounter+&quot;.tmp&quot;;

		if(!findStatus == find.FindFile(strFilePath))				// nächstes temporäres File suchen
			bBrFlg = 1;

		else
		{
			try
			{
				del.Remove(strFilePath);						// temporäres File löschen
				i++;							 // Counter für nächstes File inkrementieren
			}

			catch(CException* e)
			{	
				e-&gt;ReportError();
				e-&gt;Delete();
				return 0;
			}
		}

	}
	while(!bBrFlg);		

return 1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/387789</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387789</guid><dc:creator><![CDATA[mike2003]]></dc:creator><pubDate>Thu, 06 Nov 2003 08:37:36 GMT</pubDate></item></channel></rss>