<?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[dateien in einem verzeichnis feststellen]]></title><description><![CDATA[<p>wie kann ich ohne einbindung von weiteren bibiotheken o.a. zum Beispiel boost feststellen welche dateien im derzeitigen (per anwahl) verzeichnis sind`?</p>
<p>ein beispiel wäre nett</p>
<p>MFG terites--;</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147885/dateien-in-einem-verzeichnis-feststellen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 02:07:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147885.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 May 2006 11:22:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 11:22:21 GMT]]></title><description><![CDATA[<p>wie kann ich ohne einbindung von weiteren bibiotheken o.a. zum Beispiel boost feststellen welche dateien im derzeitigen (per anwahl) verzeichnis sind`?</p>
<p>ein beispiel wäre nett</p>
<p>MFG terites--;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062012</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 11:22:21 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 11:25:43 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>du wirst da im externe Funktionen nicht umhin kommen. Den das ist Plattform-spezifisch.<br />
Unter Windows kannst du <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/findfirstfile.asp" rel="nofollow">FindFirstFile/FindNextFile</a> einsetzen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062019</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062019</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 21 May 2006 11:25:43 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 11:28:32 GMT]]></title><description><![CDATA[<p>könntest du mir damit ein kleines beispiel zeigen? mit der msdn komm ich nie ganz klar <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1062025</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062025</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 11:28:32 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 11:34:18 GMT]]></title><description><![CDATA[<p>entschuldigung.. da war ja ein beispiel dabei. nun hab ich etwas ausprobiert aber er zeigt mir einen smiley und ein gleichzeichen nach 1.txt:</p>
<p>#define _WIN32_WINNT 0x0400</p>
<p>#include &lt;windows.h&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>int main()<br />
{<br />
WIN32_FIND_DATA FindFileData;<br />
HANDLE hFind;<br />
char dada[5] = {'1','.','t','x','t'};<br />
printf (&quot;Target file is %s.\n&quot;, dada);<br />
hFind = FindFirstFile(dada, &amp;FindFileData);<br />
if (hFind == INVALID_HANDLE_VALUE)<br />
{<br />
printf (&quot;Invalid File Handle. GetLastError reports %d\n&quot;,<br />
GetLastError ());<br />
Sleep(10000);<br />
return (0);<br />
}<br />
else<br />
{<br />
printf (&quot;The first file found is %s\n&quot;,<br />
FindFileData.cFileName);<br />
FindClose(hFind);<br />
Sleep(10000);<br />
return (1);<br />
}<br />
Sleep(10000);<br />
}</p>
<p>die sleeps sind nur da damit ich auch etwas lesen kann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062033</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 11:34:18 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 11:50:32 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>dann mach dir doch mal klar, was das Programm machen soll. Denn es sucht die Datei 1.txt im aktuellen Pfad.<br />
Allerdings ist dort tatsächlich ein kleiner Fehler, das Array ist nicht Null-Terminiert deshalb ist die Ausgabe nicht korrekt :</p>
<pre><code class="language-cpp">char dada[6] = {'1','.','t','x','t', '\0'};
</code></pre>
<p>Mehr Infos findest du im WinAPI-Forum, zum Beispiel <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-146519-and-highlight-is-%2Afindfirstfile%2A.html" rel="nofollow">hier</a></p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062048</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 21 May 2006 11:50:32 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 13:39:59 GMT]]></title><description><![CDATA[<p>ok danke. ich habe nun auch ein programm gefunden das die dateien im ordner anzeigt. es werden aber jetzt nicht alle dateien angezeigt. woran kann das liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062109</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 13:39:59 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 13:52:59 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>woher sollen wir das ohne Quellcode wissen?</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062117</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 21 May 2006 13:52:59 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 15:31:44 GMT]]></title><description><![CDATA[<p>mmhh, ich verweise an dieser stelle mal auf die boost lib</p>
<p>check this out <a href="http://boost.org/libs/filesystem/doc/index.htm" rel="nofollow">http://boost.org/libs/filesystem/doc/index.htm</a></p>
<p>habs selber erst vor kurzem getestet und funzt wunderbar <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1062174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062174</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Sun, 21 May 2006 15:31:44 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 15:37:56 GMT]]></title><description><![CDATA[<p>ok noch eine frage: woher weiß ich was ein verzeichnis und was eine datei ist? mir wird beides als datei angezeigt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062185</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 15:37:56 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 15:48:17 GMT]]></title><description><![CDATA[<p>was nutz du nun ? win32 api oder boost?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062195</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062195</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Sun, 21 May 2006 15:48:17 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 15:53:36 GMT]]></title><description><![CDATA[<p>winapi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062198</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062198</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 15:53:36 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 16:05:48 GMT]]></title><description><![CDATA[<p>so da muss ich doch mal in meinen projekten wühlen...</p>
<pre><code class="language-cpp">WIN32_FIND_DATA w32fd;

if( w32fd.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY ){  //datei ist ein ordner
	//mach irgenwas mit dem ordner		
}
else{//datei ist eine datei
        //mach irgendwas mit der datei
}
</code></pre>
<p>w32fd.cFileName gibt nen cstring an...was der name der datei wäre...</p>
<p>guckst du hier: <a href="http://www.microsoft.com/germany/msdn/library/office/RekursiveDateisuche.mspx?mfr=true" rel="nofollow">http://www.microsoft.com/germany/msdn/library/office/RekursiveDateisuche.mspx?mfr=true</a></p>
<p>und ich erinnere dich nochmal an boost...ist viel einfacher...und sollte plattformunabhängig sein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062204</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Sun, 21 May 2006 16:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 16:11:42 GMT]]></title><description><![CDATA[<p>habs noch nicht auf die reihe bekommen boost mit in codeblocks zu linken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062206</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062206</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 16:11:42 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 16:21:27 GMT]]></title><description><![CDATA[<p>welche file_attribute gibt es noch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062211</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062211</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 16:21:27 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 16:36:25 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das steht alles in der <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/win32_find_data_str.asp" rel="nofollow">MSDN</a></p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062219</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 21 May 2006 16:36:25 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 16:41:40 GMT]]></title><description><![CDATA[<p><a href="http://msdn2.microsoft.com/de-de/library/3k3z0k7a.aspx" rel="nofollow">http://msdn2.microsoft.com/de-de/library/3k3z0k7a.aspx</a></p>
<p>und hier aus der winnt.h kopiert...</p>
<pre><code class="language-cpp">#define FILE_ATTRIBUTE_READONLY             0x00000001  
#define FILE_ATTRIBUTE_HIDDEN               0x00000002  
#define FILE_ATTRIBUTE_SYSTEM               0x00000004  
#define FILE_ATTRIBUTE_DIRECTORY            0x00000010  
#define FILE_ATTRIBUTE_ARCHIVE              0x00000020  
#define FILE_ATTRIBUTE_DEVICE               0x00000040  
#define FILE_ATTRIBUTE_NORMAL               0x00000080  
#define FILE_ATTRIBUTE_TEMPORARY            0x00000100  
#define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200  
#define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400  
#define FILE_ATTRIBUTE_COMPRESSED           0x00000800  
#define FILE_ATTRIBUTE_OFFLINE              0x00001000  
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000  
#define FILE_ATTRIBUTE_ENCRYPTED            0x00004000
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1062224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062224</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Sun, 21 May 2006 16:41:40 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 17:07:51 GMT]]></title><description><![CDATA[<p>und nochmal eine frage: im laufwerk c: dort habe ich nur windows und den standart programmordner, wird mir der ordner &quot;programme&quot; als datei angezeigt. warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062239</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Sun, 21 May 2006 17:07:51 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 17:18:36 GMT]]></title><description><![CDATA[<p>ka. ohne source code ist das sehr schwer, wenn nicht gar unmöglich nachzuvollziehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062249</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Sun, 21 May 2006 17:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Sun, 21 May 2006 19:57:09 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/1062367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062367</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 21 May 2006 19:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Mon, 22 May 2006 09:51:40 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#define _WIN32_WINNT 0x0501

#include &lt;windows.h&gt;
#include &lt;string.h&gt;
#include &lt;stdio.h&gt;
#include &lt;iostream&gt;
using namespace std;

int main(int argc, char *argv[])
{
   WIN32_FIND_DATA FindFileData;
   HANDLE hFind = INVALID_HANDLE_VALUE;
   char DirSpec[MAX_PATH + 1];  // directory specification
   DWORD dwError;

   printf (&quot;Target directory is %s.\n&quot;, argv[1]);
   strncpy (DirSpec, argv[1], strlen(argv[1])+1);
   strncat (DirSpec, &quot;\\*&quot;, 3);

   hFind = FindFirstFile(DirSpec, &amp;FindFileData);

   if (hFind == INVALID_HANDLE_VALUE)
   {
      printf (&quot;Invalid file handle. Error is %u\n&quot;, GetLastError());
      return (-1);
   }

   else
   {
       while (FindNextFile(hFind, &amp;FindFileData) != 0)
       {
           if( FindFileData.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY )
           {
               cout &lt;&lt; &quot;Directory: &quot; &lt;&lt; FindFileData.cFileName &lt;&lt; &quot;\n&quot;;
           }
           else
           {
               cout &lt;&lt; &quot;File: &quot; &lt;&lt; FindFileData.cFileName &lt;&lt; &quot;\n&quot;;
           }

       }
      dwError = GetLastError();
      FindClose(hFind);
      if (dwError != ERROR_NO_MORE_FILES)
      {
         printf (&quot;FindNextFile error. Error is %u\n&quot;, dwError);
         return (-1);
      }
   }
   return 0;
}
</code></pre>
<p>Das ist das gemeinte Programm. Ab und zu werden dort Ordner als Dateien angegeben oder habe ich etwas nicht berücksichtigt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062628</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Mon, 22 May 2006 09:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Mon, 22 May 2006 09:56:19 GMT]]></title><description><![CDATA[<p>terites--; schrieb:</p>
<blockquote>
<p>oder habe ich etwas nicht berücksichtigt?</p>
</blockquote>
<p>Hast du. Die Dateiattribute sind Flags, die miteinander kombiniert werden können. Es reicht also nicht aus, auf Gleichheit mit FILE_ATTRIBUTE_DIRECTORY zu prüfen, denn damit erreichst du nur die Verzeichnisse, bei denen kein anderes Flag gesetzt ist.</p>
<p>Formulier die Prüfung so:</p>
<pre><code class="language-cpp">if( FindFileData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY )
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1062635</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062635</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 22 May 2006 09:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Mon, 22 May 2006 11:13:54 GMT]]></title><description><![CDATA[<p>ok verständlich aber was genau heißt das jetzt in logiksprache?</p>
<p>if( FindFileData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY )</p>
<p>&amp; ist ja kein &amp;&amp; also was sagt das dem compiler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062686</guid><dc:creator><![CDATA[terites--;]]></dc:creator><pubDate>Mon, 22 May 2006 11:13:54 GMT</pubDate></item><item><title><![CDATA[Reply to dateien in einem verzeichnis feststellen on Mon, 22 May 2006 11:30:20 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das einfache &amp; ist eine <a href="http://www.willemer.de/informatik/cpp/sysprog.htm" rel="nofollow">Bitoperation</a>, genauer gesagt ein binäres AND.</p>
<p>In deinem Fall wird geprüft, ob die Bits die in FILE_ATTRIBUTE_DIRECTORY auf 1 stehen (und das ist genau eins), auch in FindFileData.dwFileAttributes gesetzt sind.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1062694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1062694</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 22 May 2006 11:30:20 GMT</pubDate></item></channel></rss>