<?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[Komplettes Verzeichniss kopieren]]></title><description><![CDATA[<p>Hat jemand ne Idee, wie ich ein komplettes Verzeichnis Kopieren kann (also ne Funktion, an die der Verzeichnispfad und der Zielpfad übergeben werden)??</p>
<p>Das Programm, für das das ist, befindet sich auf einer CD und wird aufgerufen und soll dann an einen übergebenen Pfad ein Verzeichnis von der CD kopieren.</p>
<p>(Arbeite mit Borland C++ Builder Standard)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/168540/komplettes-verzeichniss-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 12:55:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/168540.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Dec 2006 22:44:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komplettes Verzeichniss kopieren on Sat, 23 Dec 2006 22:44:01 GMT]]></title><description><![CDATA[<p>Hat jemand ne Idee, wie ich ein komplettes Verzeichnis Kopieren kann (also ne Funktion, an die der Verzeichnispfad und der Zielpfad übergeben werden)??</p>
<p>Das Programm, für das das ist, befindet sich auf einer CD und wird aufgerufen und soll dann an einen übergebenen Pfad ein Verzeichnis von der CD kopieren.</p>
<p>(Arbeite mit Borland C++ Builder Standard)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197202</guid><dc:creator><![CDATA[*gt*Bocky*lt*]]></dc:creator><pubDate>Sat, 23 Dec 2006 22:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Verzeichniss kopieren on Sun, 24 Dec 2006 02:21:08 GMT]]></title><description><![CDATA[<p>Ich kann Dir das nur als WinAPI/MFC-Schnippsel geben, aber das Prinzip stimmt:</p>
<p>Diese Funktion gibt Dir die Anzahl Dateien im angegebenen Quellpfad zurück, z.B. um später einen Kopierzustand in Prozent angeben zu können oder einfach zur Kontrolle:</p>
<pre><code class="language-cpp">long CountFiles(CString pstrSourcePath)
{
	BOOL bMore;
	WIN32_FIND_DATA wfd;
	HANDLE handle;
	CString szMask;
	CString szFullName;

	szMask = pstrSourcePath + &quot;\\*.*&quot;;		//Suchmaske für FindFirstFile

	handle = ::FindFirstFile(szMask, &amp;wfd);
	bMore = handle != INVALID_HANDLE_VALUE;

	while(bMore)
	{
		if(wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
		{
			if(	((strcmp(wfd.cFileName, &quot;.&quot;)  != 0) &amp;&amp; 
				 (strcmp(wfd.cFileName, &quot;..&quot;) != 0)) )		// filename is a directory
			{
				szFullName = pstrSourcePath + &quot;\\&quot; + wfd.cFileName;
				CountFiles(szFullName);	//Funktion rekursiv aufrufen
			}/*if*/
		}/*if*/

		else
		{
			CString SourceFile = pstrSourcePath + &quot;\\&quot; + wfd.cFileName;
			m_lNumFiles++;

			/*
			MSG msg;
			int Return = PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE);
			if (Return!=0)
			{
				TranslateMessage(&amp;msg);
				DispatchMessage(&amp;msg);
			}
			*/
		}/*else*/

		bMore = ::FindNextFile(handle,&amp;wfd);

	}/*while*/

	if (handle!=INVALID_HANDLE_VALUE) ::FindClose(handle);

	return m_lNumFiles;
}////////////////////Ende Funktion
</code></pre>
<p>Diese Funktion kopiert nun alle Dateien (incl. Unterverzeichnisse) vom angegebenen Quellpfad in den angegebenen Zielpfad:</p>
<pre><code class="language-cpp">BOOL SnapshotFiles(CString pstrSourcePath, CString pstrTargetPath)
{
	BOOL bMore;
	WIN32_FIND_DATA wfd;
	HANDLE handle;
	CString szMask;
	CString szFullName;
	CString szTargetName;

	CreateDirectory(pstrTargetPath, NULL);	//Zielverzeichnis erstellen
	szMask = pstrSourcePath + &quot;\\*.*&quot;;		//Suchmaske für FindFirstFile

	handle = ::FindFirstFile(szMask, &amp;wfd);
	bMore = handle != INVALID_HANDLE_VALUE;

	while(bMore)
	{
		if(wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
		{
			if(	((strcmp(wfd.cFileName, &quot;.&quot;)  != 0) &amp;&amp; 
				 (strcmp(wfd.cFileName, &quot;..&quot;) != 0)) )		// filename is a directory
			{
				szFullName = pstrSourcePath + &quot;\\&quot; + wfd.cFileName;
				szTargetName = pstrTargetPath + &quot;\\&quot; + wfd.cFileName;
				CreateDirectory(szTargetName, NULL);		//Ziel-Unterverzeichnisse erstellen

				m_ctlStaticDirectory.SetWindowText(szFullName); //Verzeichnis anzeigen

				SnapshotFiles(szFullName, szTargetName);	//Funktion rekursiv aufrufen
			}/*if*/
		}/*if*/

		else
		{
			CString SourceFile = pstrSourcePath + &quot;\\&quot; + wfd.cFileName;
			CString TargetFile = pstrTargetPath + &quot;\\&quot; + wfd.cFileName;

			m_ctlStaticFile.SetWindowText(wfd.cFileName);

			::CopyFile(SourceFile, TargetFile, FALSE); //Datei wird kopiert (FALSE = überschreiben, falls vorhanden)

			UpdateWindow();

			MSG msg;
			int Return = PeekMessage(&amp;msg, NULL,0,0,PM_REMOVE);
			if(Return!=0)
			{
				TranslateMessage(&amp;msg);
				DispatchMessage(&amp;msg);
			}

			//	Prozentanteil kopierter Dateien, lNumFiles entspricht 100%.                            
			m_iZaehler++;
			m_iProzent = (int)(m_iZaehler*100/m_lNumFiles);

//////////Verzögerungsschleife für 60000 sec
			::Sleep( 60000 / m_lNumFiles ); //Falls das Kopieren zu schnell geht, manchmal sinnvoll. Ansonsten streichen.			
//////////////

		}/*else*/

		bMore = ::FindNextFile(handle,&amp;wfd);

	}/*while*/

	if (handle!=INVALID_HANDLE_VALUE) 
	{
		::FindClose(handle);
		m_ctlStaticDirectory.SetWindowText(&quot;&quot;);
		m_ctlStaticFile.SetWindowText(&quot;Alle Dateien wurden kopiert.&quot;);
	}

	return TRUE;
}////////////////////Ende Funktion
</code></pre>
<p>Einfach minimal auf Borland anpassen (m_... sind Member-Variablen, die in MFC-Klassen definiert wurden).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197245</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197245</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 24 Dec 2006 02:21:08 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Verzeichniss kopieren on Wed, 27 Dec 2006 09:55:38 GMT]]></title><description><![CDATA[<p>Nach einigen Stunden Bastelei funzt es endlich.</p>
<p>Hier der Funktionsinhalt:</p>
<blockquote>
<p>bool SnapshotFiles ( String startVerzeichnis, String zielVerzeichnis ){<br />
bool bMore;<br />
WIN32_FIND_DATA wfd;<br />
HANDLE handle;<br />
String szMask;<br />
String szFullName;<br />
String szTargetName;<br />
int m_ctlStaticFile = 0;</p>
<p>mkdir(zielVerzeichnis.c_str()); //Zielverzeichnis erstellen<br />
szMask = startVerzeichnis + &quot;\*.*&quot;; //Suchmaske für FindFirstFile<br />
handle = ::FindFirstFile(szMask.c_str(), &amp;wfd);<br />
bMore = handle != INVALID_HANDLE_VALUE;</p>
<p>while(bMore){<br />
if(wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY){<br />
if( ((strcmp(wfd.cFileName, &quot;.&quot;) != 0) &amp;&amp; (strcmp(wfd.cFileName, &quot;..&quot;) != 0)) ){ // filename is a directory</p>
<p>szFullName = startVerzeichnis + &quot;\&quot; + wfd.cFileName;<br />
szTargetName = zielVerzeichnis + &quot;\&quot; + wfd.cFileName;<br />
mkdir(szTargetName.c_str()); //Ziel-Unterverzeichnisse erstellen</p>
<p>SnapshotFiles(szFullName, szTargetName); //Funktion rekursiv aufrufen<br />
}/*if*/<br />
}/*if*/<br />
else{<br />
String SourceFile = startVerzeichnis + &quot;\&quot; + wfd.cFileName;<br />
String TargetFile = zielVerzeichnis + &quot;\&quot; + wfd.cFileName;</p>
<p>::CopyFile(SourceFile.c_str(), TargetFile.c_str(), FALSE); //Datei wird kopiert (FALSE = überschreiben, falls vorhanden)</p>
<p>MSG msg;<br />
int Return = PeekMessage(&amp;msg, NULL,0,0,PM_REMOVE);<br />
if(Return!=0){<br />
TranslateMessage(&amp;msg);<br />
DispatchMessage(&amp;msg);<br />
}</p>
<p>}/*else*/<br />
bMore = ::FindNextFile(handle,&amp;wfd);<br />
}/*while*/<br />
if (handle!=INVALID_HANDLE_VALUE){<br />
::FindClose(handle);<br />
return true;<br />
}<br />
}</p>
</blockquote>
<p>Im Header hab ich noch die Datei &quot;dir.h&quot; includet.<br />
Die Prozentanteile hab ich rausgenommen.</p>
<p>Aber ich hab jetzt neue Probleme:<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Wie kann ich relative Pfadangaben nutzen?<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Wie kann ich mit meinem Programm ein anderes Programm so starten, wie ich es in Windows mache (bzw. es ist eine .bat-Datei)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197732</guid><dc:creator><![CDATA[*gt*Bocky*lt*]]></dc:creator><pubDate>Wed, 27 Dec 2006 09:55:38 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Verzeichniss kopieren on Thu, 28 Dec 2006 10:15:56 GMT]]></title><description><![CDATA[<p>Hab ma in der Hilfe nachgeguckt: Wie man Dateien mit &quot;execle&quot; öffnen (ich versteh das mit dem Syntax nicht)?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1198884</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1198884</guid><dc:creator><![CDATA[*gt*Bocky*lt*]]></dc:creator><pubDate>Thu, 28 Dec 2006 10:15:56 GMT</pubDate></item><item><title><![CDATA[Reply to Komplettes Verzeichniss kopieren on Thu, 28 Dec 2006 10:59:26 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=10455" rel="nofollow">evilissimo</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=2" rel="nofollow">VCL/CLX (Borland C++ Builder)</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/1198901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1198901</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 28 Dec 2006 10:59:26 GMT</pubDate></item></channel></rss>