<?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[Ordner Inhalt löschen]]></title><description><![CDATA[<p>Hi</p>
<p>Ich bin C++ Neuling! Um zu üben habe ich folgendes &quot;Programm&quot; geschrieben:</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;
#include &lt;string.h&gt;

typedef struct _WIN32_FIND_DATA { // wfd 
    DWORD dwFileAttributes; 
    FILETIME ftCreationTime; 
    FILETIME ftLastAccessTime; 
    FILETIME ftLastWriteTime; 
    DWORD    nFileSizeHigh; 
    DWORD    nFileSizeLow; 
    DWORD    dwReserved0; 
    DWORD    dwReserved1; 
    TCHAR    cFileName[ MAX_PATH ]; 
    TCHAR    cAlternateFileName[ 14 ]; 
}; 

WIN32_FIND_DATA wfd;
HANDLE fHandle;
TCHAR TempPath[] = {&quot;C:\\Dokumente und Einstellungen\\Besitzer\\Desktop\\Neuer Ordner\\*&quot;};

int main ()

{
fHandle=FindFirstFile(TempPath,&amp;wfd); 

while (FindNextFile(fHandle,&amp;wfd))
{
//http://www.cplusplus.com/ref/cstdio/remove.html
   if( remove(wfd.cFileName) == -1 )
    perror( &quot;Error deleting file&quot; );
  else
    puts( &quot;File successfully deleted&quot; );
  return 0;
}
FindClose(fHandle);

}
</code></pre>
<p>Jedoch funktioniert der Code nicht! Weshalb?</p>
<p>Lg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/109788/ordner-inhalt-löschen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 15:28:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/109788.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 May 2005 16:29:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ordner Inhalt löschen on Fri, 13 May 2005 16:29:43 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich bin C++ Neuling! Um zu üben habe ich folgendes &quot;Programm&quot; geschrieben:</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;
#include &lt;string.h&gt;

typedef struct _WIN32_FIND_DATA { // wfd 
    DWORD dwFileAttributes; 
    FILETIME ftCreationTime; 
    FILETIME ftLastAccessTime; 
    FILETIME ftLastWriteTime; 
    DWORD    nFileSizeHigh; 
    DWORD    nFileSizeLow; 
    DWORD    dwReserved0; 
    DWORD    dwReserved1; 
    TCHAR    cFileName[ MAX_PATH ]; 
    TCHAR    cAlternateFileName[ 14 ]; 
}; 

WIN32_FIND_DATA wfd;
HANDLE fHandle;
TCHAR TempPath[] = {&quot;C:\\Dokumente und Einstellungen\\Besitzer\\Desktop\\Neuer Ordner\\*&quot;};

int main ()

{
fHandle=FindFirstFile(TempPath,&amp;wfd); 

while (FindNextFile(fHandle,&amp;wfd))
{
//http://www.cplusplus.com/ref/cstdio/remove.html
   if( remove(wfd.cFileName) == -1 )
    perror( &quot;Error deleting file&quot; );
  else
    puts( &quot;File successfully deleted&quot; );
  return 0;
}
FindClose(fHandle);

}
</code></pre>
<p>Jedoch funktioniert der Code nicht! Weshalb?</p>
<p>Lg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788090</guid><dc:creator><![CDATA[*JoE*]]></dc:creator><pubDate>Fri, 13 May 2005 16:29:43 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Fri, 13 May 2005 17:04:12 GMT]]></title><description><![CDATA[<p>keine ahnung. was soll es machen? was macht es? kommen fehlermeldungen? sagt der compiler irgendwas?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788101</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Fri, 13 May 2005 17:04:12 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Fri, 13 May 2005 18:02:01 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Der Code sollte alle Datein in dem angegebenen Pfad löschen. Der Compiler compiliert fehlerlos. Als Ausgabestring erhalte ich: Error deleting file: Permission denied. Ich habe Adminrechte, der Inhalt sollte also problemlos gelöscht werden können.</p>
<p>Lg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788133</guid><dc:creator><![CDATA[*JoE*]]></dc:creator><pubDate>Fri, 13 May 2005 18:02:01 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Fri, 13 May 2005 18:30:08 GMT]]></title><description><![CDATA[<p>dann versuch doch mal die datei von hand zu löschen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788142</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Fri, 13 May 2005 18:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Sat, 14 May 2005 10:06:29 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Das manuelle Löschen funktioniert. Der Code ist irgendwie nicht richtig oder unfollständig.</p>
<p>Lg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788316</guid><dc:creator><![CDATA[*JoE*]]></dc:creator><pubDate>Sat, 14 May 2005 10:06:29 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Sat, 14 May 2005 12:22:51 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream.h&gt; 
#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

typedef struct _WIN32_FIND_DATA { // Struktur für Find*File
    DWORD dwFileAttributes; 
    FILETIME ftCreationTime; 
    FILETIME ftLastAccessTime; 
    FILETIME ftLastWriteTime; 
    DWORD    nFileSizeHigh; 
    DWORD    nFileSizeLow; 
    DWORD    dwReserved0; 
    DWORD    dwReserved1; 
    TCHAR    cFileName[ MAX_PATH ]; 
    TCHAR    cAlternateFileName[ 14 ]; 
}; 

WIN32_FIND_DATA wfd;
HANDLE fHandle;

char TempPath1[] = {&quot;C:\\Neuer Ordner\\*&quot;};
char TempPath2[] = {&quot;C:\\Neuer Ordner\\&quot;};
char* WholePath;
char* add(char*);

int main ()
{

    cout &lt;&lt; &quot;Direction: &quot; &lt;&lt; TempPath2 &lt;&lt; &quot;\n&quot;;

    fHandle=FindFirstFile(TempPath1,&amp;wfd);  // erstes Handle holen, öffnen

    FindNextFile(fHandle,&amp;wfd); // zweites überspringen weil :/.

    while (FindNextFile(fHandle,&amp;wfd)) // alle Datein durchspielen
    {
      if ( remove(add(wfd.cFileName)) == -1 ) // löschen
      {
            cout &lt;&lt; &quot;Error: not deleted file\n&quot;;
      }
      else
      {
            cout &lt;&lt; &quot;File successfully deleted\n&quot; ;
      }
    }

    FindClose(fHandle); // Handle abschliessen

}

char* add( char *FileName ) // Funktion für String Addition
{
  WholePath = new char[strlen(TempPath2)+strlen(FileName)+1];  // Länge festlegen
  strcpy(WholePath, TempPath2); // erster String rein kopieren
  strcat(WholePath, FileName); // zweiter String anhängen
  cout &lt;&lt; &quot;Filename: &quot; &lt;&lt; FileName &lt;&lt; &quot;\n&quot;;
  return WholePath;
  delete []WholePath;
}
</code></pre>
<p>Entstand nach einigen Überlegungen, nach einem guten Mitagessen.</p>
<p>Lg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/788405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788405</guid><dc:creator><![CDATA[*JoE*]]></dc:creator><pubDate>Sat, 14 May 2005 12:22:51 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner Inhalt löschen on Sat, 14 May 2005 12:51:39 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/788440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/788440</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sat, 14 May 2005 12:51:39 GMT</pubDate></item></channel></rss>