<?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]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe ein kleineres Problem:<br />
Ich möchte ein Programm schreiben (Konsole mit Dev-C++) das eine Datei kopiert, dazu muss ich zuerst die Datei komplett einlesen.<br />
Ich habe es oft versucht aber jedes mal liest er mir nur eine Zeile!<br />
Wie kann ich die gesamte Datie in einer Variable speichern, ewentuell verändern und dann wieder ausgeben?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/214414/datei-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 11:38:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/214414.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 May 2008 19:26:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei kopieren on Wed, 28 May 2008 19:26:08 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe ein kleineres Problem:<br />
Ich möchte ein Programm schreiben (Konsole mit Dev-C++) das eine Datei kopiert, dazu muss ich zuerst die Datei komplett einlesen.<br />
Ich habe es oft versucht aber jedes mal liest er mir nur eine Zeile!<br />
Wie kann ich die gesamte Datie in einer Variable speichern, ewentuell verändern und dann wieder ausgeben?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518706</guid><dc:creator><![CDATA[tuxer]]></dc:creator><pubDate>Wed, 28 May 2008 19:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Wed, 28 May 2008 19:49:03 GMT]]></title><description><![CDATA[<p>Zeig mal den Code, den du bereits hast..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518720</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518720</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 28 May 2008 19:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Wed, 28 May 2008 19:59:45 GMT]]></title><description><![CDATA[<p>Warum willst du die Datei komplett einlesen? Tuts nicht auch im Prinzip &quot;Lies eine Zeile - schreib eine Zeile in neue Datei - lies die nächste Zeile - schreib die nächste Zeile&quot; so lange bis die Quelldatei vollständig gelesen ist?</p>
<p>Ich hoffe, das hilft weiter, zeig einfach mal deinen Ansatz!</p>
<p>Gruß,<br />
U-Boot</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518724</guid><dc:creator><![CDATA[U-Boot]]></dc:creator><pubDate>Wed, 28 May 2008 19:59:45 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 05:54:22 GMT]]></title><description><![CDATA[<p>Wie hast du es denn eingelesen ??? Code ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518817</guid><dc:creator><![CDATA[DataByte]]></dc:creator><pubDate>Thu, 29 May 2008 05:54:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 05:57:15 GMT]]></title><description><![CDATA[<p>Datei binär öffnen, und byte für byte , kopieren bzw. bytes für bytes.. je nach buffer..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1518818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1518818</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Thu, 29 May 2008 05:57:15 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 13:35:33 GMT]]></title><description><![CDATA[<p>Ich habe das ungefähr so:</p>
<pre><code>string pfad, neuerPfad;
cin&gt;&gt;pfad;

neuerPfad = NeuenPfadErstellen(pfad);
 //Die Funktion NeuenPfadErstellen macht zB aus neu.txt neu(Kopie).txt

 fstream in;
   in.open(pfad.c_str(), ios::in);

        string  inhalt=&quot;&quot;;
        char c;
        while(in.get(c))
        inhalt+=c; 

    fstream out;
    out.open(neuerPfad.c_str(), ios::out);
    out&lt;&lt;all;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1519130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519130</guid><dc:creator><![CDATA[tuxer]]></dc:creator><pubDate>Thu, 29 May 2008 13:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 13:45:34 GMT]]></title><description><![CDATA[<p>Schau auch mal hier<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-200903.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-200903.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1519145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519145</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 29 May 2008 13:45:34 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 13:58:19 GMT]]></title><description><![CDATA[<p>Nein mit dem Programm lassen sich zwar mehrzeilige Textdateien kopieren aber nicht andere Dateien wie .exe oder .jpg!</p>
<pre><code>fstream in, out;

   in.open(pfad.c_str(), ios::in);
   out.open(neuerPfad.c_str(), ios::out);

   out&lt;&lt;in.rdbuf();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1519161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519161</guid><dc:creator><![CDATA[tuxer]]></dc:creator><pubDate>Thu, 29 May 2008 13:58:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 14:08:14 GMT]]></title><description><![CDATA[<p>Dev-C++ == Windows == &quot;CopyFile(SourceFile, TargetFile);&quot;</p>
<p>#InDenRaumWerf #gg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1519172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519172</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 29 May 2008 14:08:14 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 14:16:47 GMT]]></title><description><![CDATA[<p>tuxer schrieb:</p>
<blockquote>
<p>Nein mit dem Programm lassen sich zwar mehrzeilige Textdateien kopieren aber nicht andere Dateien wie .exe oder .jpg!</p>
<pre><code>fstream in, out;

   in.open(pfad.c_str(), ios::in);
   out.open(neuerPfad.c_str(), ios::out);
   
   out&lt;&lt;in.rdbuf();
</code></pre>
</blockquote>
<p>Du musst die Datei im Binär-Modus lesen und schreiben, dann klappts afaik mit allen Arten von Dateien.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1519179</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519179</guid><dc:creator><![CDATA[U-Boot]]></dc:creator><pubDate>Thu, 29 May 2008 14:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Thu, 29 May 2008 14:30:22 GMT]]></title><description><![CDATA[<p>Mr Evil schrieb:</p>
<blockquote>
<p>Dev-C++ == Windows == &quot;CopyFile(SourceFile, TargetFile);&quot;</p>
<p>#InDenRaumWerf #gg</p>
</blockquote>
<p>und weil ich kdevelop benutzte, schreibe ich programme die nur unter<br />
linux laufen<br />
#kopfschüttel #</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1519187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519187</guid><dc:creator><![CDATA[Blödsinn]]></dc:creator><pubDate>Thu, 29 May 2008 14:30:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei kopieren on Fri, 30 May 2008 05:54:36 GMT]]></title><description><![CDATA[<p>Blödsinn schrieb:</p>
<blockquote>
<p>und weil ich kdevelop benutzte, schreibe ich programme die nur unter<br />
linux laufen<br />
#kopfschüttel #</p>
</blockquote>
<p>war ja auch ne ernst gemeint - darum ja das &quot;#gg&quot; hinten drann {o;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1519411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1519411</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Fri, 30 May 2008 05:54:36 GMT</pubDate></item></channel></rss>