<?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[Datei kopieren schlägt gelegentlich fehl.]]></title><description><![CDATA[<p>Das Kopieren einer Datei schlägt manchmal fehl und ich bin mir nicht sicher warum.<br />
Die Datei wird aus dem Internet erfolgreich runtergeladen und danach<br />
noch zusätzlich 1 Sekunde gewartet.</p>
<p>Manchmal klappt es und manchmal erhalte ich die Nachricht, dass von<br />
der Quelldatei nicht kopiert wurde..obwohl sie bereits im Verzeichnis liegt.</p>
<pre><code class="language-cpp">CString path1 = &quot;c:\\remote.ini&quot;;
CString pathloc =&quot;c:\\local.ini&quot;;

SHFILEOPSTRUCT lpShFileStruct; 
lpShFileStruct.pFrom = path1;
lpShFileStruct.pTo = pathloc;
lpShFileStruct.wFunc = FO_COPY;
lpShFileStruct.fFlags = FOF_NOCONFIRMMKDIR | FOF_NOCONFIRMATION | FOF_SILENT;
SHFileOperation(&amp;lpShFileStruct);
</code></pre>
<p>Hat jemand von euch eine Idee was ich da noch ändern müsste?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/183721/datei-kopieren-schlägt-gelegentlich-fehl</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 23:25:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/183721.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Jun 2007 06:52:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei kopieren schlägt gelegentlich fehl. on Fri, 08 Jun 2007 06:52:23 GMT]]></title><description><![CDATA[<p>Das Kopieren einer Datei schlägt manchmal fehl und ich bin mir nicht sicher warum.<br />
Die Datei wird aus dem Internet erfolgreich runtergeladen und danach<br />
noch zusätzlich 1 Sekunde gewartet.</p>
<p>Manchmal klappt es und manchmal erhalte ich die Nachricht, dass von<br />
der Quelldatei nicht kopiert wurde..obwohl sie bereits im Verzeichnis liegt.</p>
<pre><code class="language-cpp">CString path1 = &quot;c:\\remote.ini&quot;;
CString pathloc =&quot;c:\\local.ini&quot;;

SHFILEOPSTRUCT lpShFileStruct; 
lpShFileStruct.pFrom = path1;
lpShFileStruct.pTo = pathloc;
lpShFileStruct.wFunc = FO_COPY;
lpShFileStruct.fFlags = FOF_NOCONFIRMMKDIR | FOF_NOCONFIRMATION | FOF_SILENT;
SHFileOperation(&amp;lpShFileStruct);
</code></pre>
<p>Hat jemand von euch eine Idee was ich da noch ändern müsste?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1301083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1301083</guid><dc:creator><![CDATA[Kelly]]></dc:creator><pubDate>Fri, 08 Jun 2007 06:52:23 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren schlägt gelegentlich fehl. on Fri, 08 Jun 2007 06:56:19 GMT]]></title><description><![CDATA[<p>Soweit ich mich erinnere, muß der Name der Quelldatei <em>doppelt</em> nullterminiert werden, wenn du ihn an SHFileOperation übergibst (das betrachtet pFrom als eine Liste von möglicherweise mehreren Dateinamen, die jeweils durch \0 abgeschlossen werden - d.h. es kopiert erst die &quot;C:\Remote.ini&quot; und anschließend eine Datei, deren Name aus Datenmüll besteht (letzteres geht ziemlich sicher schief)).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1301084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1301084</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 08 Jun 2007 06:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren schlägt gelegentlich fehl. on Fri, 08 Jun 2007 07:02:39 GMT]]></title><description><![CDATA[<p>Ok, wenn ich das so richtig verstanden habe wird es so nun eher klappen:</p>
<pre><code class="language-cpp">path1 +='\0';
</code></pre>
<p>Wobei das dann bei jedem Pfad einer Kopieroperation zu machen wäre.<br />
Hat mich nur gewundert, dass es mal klappt und mal nicht.<br />
Woran kann das liegen?</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1301086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1301086</guid><dc:creator><![CDATA[Kelly]]></dc:creator><pubDate>Fri, 08 Jun 2007 07:02:39 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren schlägt gelegentlich fehl. on Fri, 08 Jun 2007 07:35:45 GMT]]></title><description><![CDATA[<p>Soweit ich weiss, kann ein CString nicht mehrere \0 haben.</p>
<pre><code>CString caption = &quot;test&quot;;

      char str[MAX_PATH];
      strcpy(str, LPCTSTR(caption));
      strcat(str, &quot;\0\0&quot;);
</code></pre>
<p>Das es manchmal funktioniert hat, liegt wohl daran, dass im &quot;Datenmüll&quot; zufällig ein NULL drinstand.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1301093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1301093</guid><dc:creator><![CDATA[Smeagol]]></dc:creator><pubDate>Fri, 08 Jun 2007 07:35:45 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren schlägt gelegentlich fehl. on Fri, 08 Jun 2007 09:04:09 GMT]]></title><description><![CDATA[<p>Smeagol schrieb:</p>
<blockquote>
<p>Soweit ich weiss, kann ein CString nicht mehrere \0 haben.</p>
</blockquote>
<p>Doch kann es!</p>
<blockquote>
<p>CString str(_T(&quot;Test&quot;));<br />
str += '\0'</p>
</blockquote>
<p>Fügt wirklich eine weitere \0 ein. Intern arbeitet CString nicht mit einer Null-terminierung sondern mit der effektiven Länge!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1301134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1301134</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 08 Jun 2007 09:04:09 GMT</pubDate></item></channel></rss>