<?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[Probleme mit seekp bei großen Dateien]]></title><description><![CDATA[<p>Hey @all,</p>
<p>vorweg nur zur Info, mit großen Dateien meine ich &gt;= 25 GB</p>
<p>Mein Problem ist nun das ich nicht weiter seeken kann als bis zum wert von LONG_MAX.</p>
<p>Wie kann ich in einer 25 GB Datei beispielsweise zum 24GB seeken und danach lesen bzw. schreiben?<br />
Mit ios::cur hatte ich es schon probiert, komme trotzdem nur bis LONG_MAX</p>
<p>Hat jemand einen Rat für mich?</p>
<p>OS: 32 bit von Windows und linux</p>
<p>Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/195239/probleme-mit-seekp-bei-großen-dateien</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 21:16:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/195239.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Oct 2007 17:48:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit seekp bei großen Dateien on Mon, 15 Oct 2007 17:48:31 GMT]]></title><description><![CDATA[<p>Hey @all,</p>
<p>vorweg nur zur Info, mit großen Dateien meine ich &gt;= 25 GB</p>
<p>Mein Problem ist nun das ich nicht weiter seeken kann als bis zum wert von LONG_MAX.</p>
<p>Wie kann ich in einer 25 GB Datei beispielsweise zum 24GB seeken und danach lesen bzw. schreiben?<br />
Mit ios::cur hatte ich es schon probiert, komme trotzdem nur bis LONG_MAX</p>
<p>Hat jemand einen Rat für mich?</p>
<p>OS: 32 bit von Windows und linux</p>
<p>Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1385851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1385851</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Mon, 15 Oct 2007 17:48:31 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit seekp bei großen Dateien on Mon, 15 Oct 2007 17:49:25 GMT]]></title><description><![CDATA[<p>WinAPI</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1385852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1385852</guid><dc:creator><![CDATA[tipp]]></dc:creator><pubDate>Mon, 15 Oct 2007 17:49:25 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit seekp bei großen Dateien on Mon, 15 Oct 2007 18:07:15 GMT]]></title><description><![CDATA[<p>Danke, und ausser WinAPI?</p>
<p>Wollte nicht die Dateioperationen für beide Systeme schreiben.</p>
<p>Gibts da nicht auch was ansi kompatibles mit fstream oder den C Funktionen (fopen, usw.) daraus?</p>
<p>Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1385862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1385862</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Mon, 15 Oct 2007 18:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit seekp bei großen Dateien on Mon, 15 Oct 2007 20:24:09 GMT]]></title><description><![CDATA[<p>habe doch noch eine Lösung gefunden:</p>
<pre><code class="language-cpp">// Für Windows
// mit fopen öffnen
_fseeki64(pFile, _offset, SEEK_SET);

// Für Linux
// mit fopen64 öffnen
// Kompilieren mit -D __USE_FILE_OFFSET64 -D __USE_LARGEFILE
_fseeko64(pFile, _offset, SEEK_SET);
</code></pre>
<p>der Rest wie fwrite,fread und fclose bleiben gleich</p>
<p>oder mittels Präprocessor</p>
<pre><code class="language-cpp">FILE *pFile = NULL;
.
.
.
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__)
    pFile = fopen(&quot;filename.ext&quot;, &quot;rb+&quot;);
#elif defined(linux) || defined(__linux)
    pFile = fopen64(&quot;filename.ext&quot;, &quot;rb+&quot;);
#endif
.
.
.
    if(pFile != NULL) {
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__)
        _fseeki64(pFile, _offset, SEEK_SET);
#elif defined(linux) || defined(__linux)
        _fseeko64(pFile, _offset, SEEK_SET);
#endif
    }
.
.
.
    fclose(pFile);
</code></pre>
<p>Lg _freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1385935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1385935</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Mon, 15 Oct 2007 20:24:09 GMT</pubDate></item></channel></rss>