<?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 Kopieren]]></title><description><![CDATA[<pre><code class="language-cpp">char * Dic;
        Dic = new char [TemporaryDic.Length()+10];
        strcpy(Dic,TemporaryDic.c_str());
        Dic[TemporaryDic.Length()] = '\0';
        Dic[TemporaryDic.Length()+1] = '\0';
        TemporaryDic = ExtractFilePath(Application-&gt;ExeName)+&quot;Caches\\&quot;+Servers-&gt;Items-&gt;Strings[Servers-&gt;ItemIndex]+&quot;\\&quot;;
        char * Dest;
        Dest = new char [TemporaryDic.Length()+10];
        strcpy(Dest,TemporaryDic.c_str());
        Dest[TemporaryDic.Length()] = '\0';
        Dest[TemporaryDic.Length()+1] = '\0';
        COPYdir( Dic,Dest);
        delete Dic,Dest;
</code></pre>
<pre><code class="language-cpp">void COPYdir(LPCTSTR srcod, LPCSTR dest)
{
SHFILEOPSTRUCT COPYDir;
ZeroMemory(&amp;COPYDir, sizeof(COPYDir));
COPYDir.wFunc = FO_COPY;
COPYDir.pFrom = srcod;
COPYDir.pTo = dest;
COPYDir.fFlags = NULL;
SHFileOperation( &amp;COPYDir);
}
</code></pre>
<p>also meine strings sind nullterminiert. für das \ verwende ich \\ ...</p>
<p>aber ürbentwie sagt er mir immer quelldatei konnte nicht gefunden werden.</p>
<p>Der ordner existiert. ich habs schon mit so wildcards probiert also <em>.</em> als &quot;letztes&quot; ( vor den 2, 0 terminierungen.( eigentlich sinds ja 3 ^^ ) oder auch mal *.. aber es kommt immer das gleiche. quelldatei konnte nicht gefunden werden</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/214923/dateien-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 20:58:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/214923.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Jun 2008 15:27:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 15:37:01 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">char * Dic;
        Dic = new char [TemporaryDic.Length()+10];
        strcpy(Dic,TemporaryDic.c_str());
        Dic[TemporaryDic.Length()] = '\0';
        Dic[TemporaryDic.Length()+1] = '\0';
        TemporaryDic = ExtractFilePath(Application-&gt;ExeName)+&quot;Caches\\&quot;+Servers-&gt;Items-&gt;Strings[Servers-&gt;ItemIndex]+&quot;\\&quot;;
        char * Dest;
        Dest = new char [TemporaryDic.Length()+10];
        strcpy(Dest,TemporaryDic.c_str());
        Dest[TemporaryDic.Length()] = '\0';
        Dest[TemporaryDic.Length()+1] = '\0';
        COPYdir( Dic,Dest);
        delete Dic,Dest;
</code></pre>
<pre><code class="language-cpp">void COPYdir(LPCTSTR srcod, LPCSTR dest)
{
SHFILEOPSTRUCT COPYDir;
ZeroMemory(&amp;COPYDir, sizeof(COPYDir));
COPYDir.wFunc = FO_COPY;
COPYDir.pFrom = srcod;
COPYDir.pTo = dest;
COPYDir.fFlags = NULL;
SHFileOperation( &amp;COPYDir);
}
</code></pre>
<p>also meine strings sind nullterminiert. für das \ verwende ich \\ ...</p>
<p>aber ürbentwie sagt er mir immer quelldatei konnte nicht gefunden werden.</p>
<p>Der ordner existiert. ich habs schon mit so wildcards probiert also <em>.</em> als &quot;letztes&quot; ( vor den 2, 0 terminierungen.( eigentlich sinds ja 3 ^^ ) oder auch mal *.. aber es kommt immer das gleiche. quelldatei konnte nicht gefunden werden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522611</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Wed, 04 Jun 2008 15:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 16:49:07 GMT]]></title><description><![CDATA[<p>Hellseher- Code ??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
<pre><code class="language-cpp">Dic = new char [TemporaryDic.Length()+10];
        strcpy(Dic,TemporaryDic.c_str());
        Dic[TemporaryDic.Length()] = '\0';
        Dic[TemporaryDic.Length()+1] = '\0';
        TemporaryDic = ExtractFilePath(Application-&gt;ExeName)+&quot;Caches\\&quot;+Servers-&gt;Items-&gt;Strings[Servers-&gt;ItemIndex]+&quot;\\&quot;;
</code></pre>
<p>1. Dic anlegen<br />
2. TemporaryDic kopieren nach Dic<br />
3. TemporaryDic mit Inhalt versehen.</p>
<p>???</p>
<p>Sicher, dass die Reihenfolge so passt?</p>
<p>Gruss<br />
Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522664</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Wed, 04 Jun 2008 16:49:07 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 16:49:27 GMT]]></title><description><![CDATA[<p>Wie lauten denn die Werte für pTo und pFrom genau?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522665</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Wed, 04 Jun 2008 16:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 17:58:08 GMT]]></title><description><![CDATA[<p>DerAltenburger schrieb:</p>
<blockquote>
<p>Hellseher- Code ??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
<p>1. Dic anlegen<br />
2. TemporaryDic kopieren nach Dic<br />
3. TemporaryDic mit Inhalt versehen.</p>
</blockquote>
<p>guck mal was drunter steht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>sri schrieb:</p>
<blockquote>
<p>Wie lauten denn die Werte für pTo und pFrom genau?</p>
</blockquote>
<p>src. F:\...\WDB\enGB\*<br />
dest. C:\Dokumente und...\Caches\Stoneraiders\</p>
<p>( Programmintern natürlich mit \\ )</p>
<p>hab schon ne idee woran es liegen könnte. an whitespaces in den zu erstellenden ordnern viell. ich hab gerade ma ne funk. geschrieben um die zu ersetzen und werd jetzt ma gucken ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522686</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Wed, 04 Jun 2008 17:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 17:43:50 GMT]]></title><description><![CDATA[<p>Probiere es mal mit</p>
<p>src. F:\...\WDB\enGB\<em>.</em><br />
dest. C:\Dokumente und...\Caches\Stoneraiders</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522705</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Wed, 04 Jun 2008 17:43:50 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Wed, 04 Jun 2008 19:45:33 GMT]]></title><description><![CDATA[<p>schon lange probiert ^^ daran liegts net.<br />
an den whitespaces übrigens auch net.<br />
übrigens. * funtzt auch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> das ist ja das blöde manchmal kopiert ers und manchmal nicht. und ich krieg net raus wann...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1522730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1522730</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Wed, 04 Jun 2008 19:45:33 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Sat, 07 Jun 2008 08:12:15 GMT]]></title><description><![CDATA[<p>Also ich hab den fehler gefunden,</p>
<p>diese methode macht anscheinend schon die ordner, die erstellung der ordner ist allerdings zu langsam und wenn er dann versucht in den ordner zu kopieren der noch erstellt wird gibt es einen fehler. also muss man wenn man in einen ordner kopieren will der noch nicht vorher existiert diesen ordner erstellen. dann gehts.</p>
<p>ich hab es jetzt so gelöst.</p>
<pre><code class="language-cpp">ShellExecute(NULL,&quot;open&quot;,&quot;cmd.exe&quot;,( &quot;/c mkdir \&quot;&quot; + TemporaryDic +&quot;\&quot;&quot; ).c_str(),NULL,SW_HIDE);
        for (int i = 0; i &lt; 30; i++){
                Sleep(100);
                Application-&gt;ProcessMessages();
        }
        if ( COPYdir( Dic,Dest ) ){
                        Label4-&gt;Caption = &quot;Couldn't Copy&quot;;

        }else{
                        Label4-&gt;Caption = &quot;Copied Successful&quot;;
        }
        delete Dic,Dest;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1524515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1524515</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Sat, 07 Jun 2008 08:12:15 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Sat, 07 Jun 2008 08:19:25 GMT]]></title><description><![CDATA[<p>rofl</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1524517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1524517</guid><dc:creator><![CDATA[loler]]></dc:creator><pubDate>Sat, 07 Jun 2008 08:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Sat, 07 Jun 2008 08:28:17 GMT]]></title><description><![CDATA[<p>hä ???</p>
<p>mach doch</p>
<pre><code class="language-cpp">move_file(&quot;von a&quot; , &quot;nach b&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1524519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1524519</guid><dc:creator><![CDATA[dumm]]></dc:creator><pubDate>Sat, 07 Jun 2008 08:28:17 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Sat, 07 Jun 2008 14:17:29 GMT]]></title><description><![CDATA[<p>*hust* deswegen heißt der thread auch &quot;Dateien Kopieren&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1524672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1524672</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Sat, 07 Jun 2008 14:17:29 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Mon, 09 Jun 2008 12:52:09 GMT]]></title><description><![CDATA[<p>Könnte man nicht auch CreateFile, ReadFile, und WriteFile fürs kopieren benutzen?<br />
-&gt; leere datei erstellen<br />
-&gt; alte datei mit read-access öffnen und auslesen<br />
-&gt; neu erstellte datei mit ausgelesenden daten vollschreiben<br />
oder wäre das z.b. zu langsam/unhandlich/.. ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1525716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1525716</guid><dc:creator><![CDATA[aawg]]></dc:creator><pubDate>Mon, 09 Jun 2008 12:52:09 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien Kopieren on Mon, 09 Jun 2008 13:30:46 GMT]]></title><description><![CDATA[<p>so hatte ich das mal gemacht.. ist imho genausoschnell wie SHFileoperation...:</p>
<pre><code class="language-cpp">bool CInstaller::CopySH(LPCTSTR pFromFolder, LPCTSTR pToFolder)
{
	//--- copy - routine ---
	CString from = pFromFolder;
	CString to   = pToFolder;

	CString sRoot = to.Left( to.Find(_T(&quot;\\&quot;)) );
	AddDirBackSlash(sRoot);

	//get free disk space on targetdrive
	__int64 i64FreeBytesToCaller, i64TotalBytes, i64FreeBytes;
	GetDiskFreeSpaceEx (sRoot, (PULARGE_INTEGER)&amp;i64FreeBytesToCaller, (PULARGE_INTEGER)&amp;i64TotalBytes,(PULARGE_INTEGER)&amp;i64FreeBytes);

	//check if more than 500 MB (512000 KB)(524288000 B) available on destination drive
	if(i64FreeBytes &lt; 524288000)
		return false;

	CString toDir = ExtractDir(to);

	//create new directory, if it don't exists
	if(! DirectoryExists(toDir))
	{
		int iPos = 0;
		while(true)
		{
			iPos = toDir.Find( _T(&quot;\\&quot;), iPos + 1 );

			if(iPos == -1)
				break;

			CString sTemp = toDir.Mid(0, iPos);
			::CreateDirectory(sTemp,NULL);
		}
	}

	try
	{
		//init source- and destinationfiles
		CFile fromFile(from, CFile::modeRead | CFile::typeBinary  | CFile::shareDenyWrite);
		CFile toFile;

		toFile.Open(to, CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);

		fromFile.SeekToBegin();
		DWORD dwRead;

		//set buffer for reading/writing files
		const int BUFSIZE = 1024;
		BYTE buffer[BUFSIZE];

		//read sourcefile and write destinationfile
		do
		{
			dwRead = fromFile.Read(buffer, BUFSIZE);
			toFile.Write(buffer, dwRead);			
		}
		while (dwRead &gt; 0);
	}
	catch( CFileException* ex)
	{
		ex-&gt;Delete();
	}

	//Set file attributes for new file
	SetFileAttributes(to, GetFileAttributes(from));

	return true;
}
</code></pre>
<p>:schland: :schland: :schland: :schland:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1525738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1525738</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Mon, 09 Jun 2008 13:30:46 GMT</pubDate></item></channel></rss>