<?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 über Netzwerk senden]]></title><description><![CDATA[<p>Hallo<br />
ich hab mir mal ein kleines Chatprogramm geschrieben, was heißt, dass ich eine Verbindung (TCP) zu einem anderen PC herstellen und Texte (Char*) hin und her schicken kann.<br />
Jetzt meine Frage: Wie funktioniert das mit dem Versenden von Dateien?<br />
Welche Funktionen benötige ich da?<br />
Oder hat mir jemand ein Tutorial dafür?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/154461/dateien-über-netzwerk-senden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 05:20:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/154461.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Jul 2006 13:02:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 13:02:30 GMT]]></title><description><![CDATA[<p>Hallo<br />
ich hab mir mal ein kleines Chatprogramm geschrieben, was heißt, dass ich eine Verbindung (TCP) zu einem anderen PC herstellen und Texte (Char*) hin und her schicken kann.<br />
Jetzt meine Frage: Wie funktioniert das mit dem Versenden von Dateien?<br />
Welche Funktionen benötige ich da?<br />
Oder hat mir jemand ein Tutorial dafür?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105368</guid><dc:creator><![CDATA[Abrow]]></dc:creator><pubDate>Thu, 27 Jul 2006 13:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 13:57:45 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=8" rel="nofollow">Rund um die Programmierung</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/1105419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105419</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 27 Jul 2006 13:57:45 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 15:58:15 GMT]]></title><description><![CDATA[<p>Wo ist das Problem?</p>
<p>Du liest die Daten aus der Datei und überträgst sie. Je nach System gibt es da noch Hilfsfunktionen, die direkt einen Dateidescriptor annehmen (Linux hat zB sendfile). Aber die machen im Grunde das gleiche nur ersparen sie dir unnötiges kopieren zwischen User- und Kernel-Space</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105518</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105518</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Thu, 27 Jul 2006 15:58:15 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 17:28:19 GMT]]></title><description><![CDATA[<p>das problem ist, dass ich allgemein nicht weiß wie das ganze funktioniert.<br />
wie les ich die daten aus? also ich will z.b. ein bild verschicken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105578</guid><dc:creator><![CDATA[Abrow]]></dc:creator><pubDate>Thu, 27 Jul 2006 17:28:19 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 21:41:26 GMT]]></title><description><![CDATA[<p>Dann ließt Du sie Binär aus und sendest das dann übers Netz. Dort schreibst du das wieder in eine Datei.<br />
Mehr ist es nicht.<br />
Netzwerkfunktionen welche nur ala senfile(from, to) erledigen nur das öffnen, schließen u.s.w.<br />
Mehr ist aber nicht dahinter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105728</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 27 Jul 2006 21:41:26 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Thu, 27 Jul 2006 22:45:06 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wie man das handhabt ist eigentlich (fast) Geschmackssache. Du kannst dir auch eine andere Möglichkeit ausdenken wie du sendest:</p>
<p>z.b Bild Pixel für Pixel auseinandernehmen und die Position eines jeden abspeichern und dann noch die Farbe.</p>
<p>class bild{<br />
int x;<br />
int y;<br />
int color;<br />
};</p>
<p>Macht man über Sockets.</p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105752</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Thu, 27 Jul 2006 22:45:06 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Fri, 28 Jul 2006 08:17:55 GMT]]></title><description><![CDATA[<p>auf</p>
<pre><code>www.pronix.de
openbooks
linux-unix
netzwerkprog.
</code></pre>
<p>wird das für linux ganz gut erklärt...<br />
wenn du linux benutzt dann guck dir das mal an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105913</guid><dc:creator><![CDATA[nochnix]]></dc:creator><pubDate>Fri, 28 Jul 2006 08:17:55 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 14:05:57 GMT]]></title><description><![CDATA[<p>hab leider nur xp drauf, aber danke soweit, werd mal weiter rumprobieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106691</guid><dc:creator><![CDATA[Abrow]]></dc:creator><pubDate>Sat, 29 Jul 2006 14:05:57 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 18:48:29 GMT]]></title><description><![CDATA[<p>wenn ich jetzt beispielsweiße ein wallpaper mit 1024x768 pixel versenden will und den binär auslese, wie viel zeichen muss ich da dann circa angeben, wenn ich mit send() arbeite?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106852</guid><dc:creator><![CDATA[Abrow]]></dc:creator><pubDate>Sat, 29 Jul 2006 18:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 18:55:41 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">while(getc(FILE *) != EOF)
              file_size++;
</code></pre>
<p>und schon hast du die groesse</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106856</guid><dc:creator><![CDATA[Moh]]></dc:creator><pubDate>Sat, 29 Jul 2006 18:55:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 23:09:18 GMT]]></title><description><![CDATA[<p>Moh schrieb:</p>
<blockquote>
<pre><code class="language-cpp">while(getc(FILE *) != EOF)
              file_size++;
</code></pre>
<p>und schon hast du die groesse</p>
</blockquote>
<p>nö, bei Binär-Dateien gibt es afaik kein EOF.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11206">@Abrow</a><br />
über Systemfunktionen findet man raus, wie groß eine Datei ist. Keine Ahnung welche Funktionen das für Windows sind. Bei Unix oder Linux ist es <a href="http://man.cx/stat(2)" rel="nofollow">man: stat(2)</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106929</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Sat, 29 Jul 2006 23:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 23:35:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Du kannst theoretisch die Filestream benutzen:</p>
<p>file.seekg(0L,SEEK_END);<br />
file.tellg();</p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106936</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Sat, 29 Jul 2006 23:35:51 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 23:37:27 GMT]]></title><description><![CDATA[<p>winexec* schrieb:</p>
<blockquote>
<p>Du kannst theoretisch die Filestream benutzen:</p>
<p>file.seekg(0L,SEEK_END);<br />
file.tellg();</p>
</blockquote>
<p>Funktioniert bei Binär-Dateien so weit ich weiß auch nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106937</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106937</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Sat, 29 Jul 2006 23:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sat, 29 Jul 2006 23:41:41 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Alle Dateien sind binär.</p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106939</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Sat, 29 Jul 2006 23:41:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sun, 30 Jul 2006 08:44:12 GMT]]></title><description><![CDATA[<p>also bei mir funktioniert meine methode einwandfrei, ich hab erst letztens einen file-splitter mit dieser methode gebastelt...</p>
<p>der splitter zerlegt eine originaldatei in mehrere kleine dateien und ein unsplitter kann diese wieder zusammensetzen. und die zusammengesetzte datei entsprach exakt dem original</p>
<p>edit:</p>
<p>probier doch mal</p>
<pre><code class="language-cpp">while((c = getc(FILE *)) != EOF)
              putc(c, FILE*);
</code></pre>
<p>mit einer mp3 datei oder einem video. (dass alles binaer geoeffnet werden muss ist klar) es sollte eine exakte kopie machen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1106975</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1106975</guid><dc:creator><![CDATA[Moh]]></dc:creator><pubDate>Sun, 30 Jul 2006 08:44:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sun, 30 Jul 2006 12:27:19 GMT]]></title><description><![CDATA[<p>also eigentlich sollte dies doch folgendermasen funktionieren:</p>
<pre><code class="language-cpp">FILE* filestream = fopen(&quot;Datei.dat&quot;, &quot;r&quot;);
if(!filestream)
{ return; }

if(!fseek(filestream, 0, SEEK_END))
{
    long lsize = ftell(filestream);

    if(lsize &gt; 0)
    {
        char* pBuffer = (char*)malloc(lsize);

        if(pBuffer)    // Danke Swordfish ^^
        {
            if(!fseek(filestream, 0, SEEK_SET))
            {

                long lcount = fread(pBuffer, sizeof(char), lsize, filestream);

                if(lcount &lt; lsize);
                    // Es gab einen Fehler oder das Ende des Files wurde erreicht. Siehe ferror bzw. feof

                // Daten senden
            }

            free(pBuffer);
        }
    }
}

fclose(filestream);
</code></pre>
<p>Oder nicht?<br />
Denn so hat man ein Array von char Werten, welche er versenden kann. Drüben muss das ganze halt dann nur wieder in der richtigen reihenfolge in ein File geschrieben werden (fwrite).</p>
<p>Edit:<br />
Kleine korrektur im Code ...</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107011</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 30 Jul 2006 12:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sun, 30 Jul 2006 11:53:11 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<pre><code class="language-cpp">if( !pBuffer )
</code></pre>
</blockquote>
<p>wohl eher:</p>
<pre><code class="language-cpp">if( pBuffer )
</code></pre>
<p>Greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107095</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Sun, 30 Jul 2006 11:53:11 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien über Netzwerk senden on Sun, 30 Jul 2006 12:07:08 GMT]]></title><description><![CDATA[<p>Moh schrieb:</p>
<blockquote>
<pre><code class="language-cpp">while(getc(FILE *) != EOF)
              file_size++;
</code></pre>
<p>und schon hast du die groesse</p>
</blockquote>
<p>Habs jetzt so gemacht, funktioniert einwandfrei, danke <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="🙂"
    /> <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107104</guid><dc:creator><![CDATA[Abrow]]></dc:creator><pubDate>Sun, 30 Jul 2006 12:07:08 GMT</pubDate></item></channel></rss>