<?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[Herausfinden, ob fstream mit ios_base::binary geöffnet wurde]]></title><description><![CDATA[<p>Hi!</p>
<p>Kann ich, wenn ich einen ofstream/ifstream habe, herausfinde, ob der Stream mit ios_base::binary geöffnet wurde?</p>
<p>Grüßerchen,<br />
Badestrand</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/225218/herausfinden-ob-fstream-mit-ios_base-binary-geöffnet-wurde</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 18:53:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/225218.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Oct 2008 23:40:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Mon, 20 Oct 2008 23:40:21 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Kann ich, wenn ich einen ofstream/ifstream habe, herausfinde, ob der Stream mit ios_base::binary geöffnet wurde?</p>
<p>Grüßerchen,<br />
Badestrand</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1601968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1601968</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 20 Oct 2008 23:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Mon, 20 Oct 2008 23:58:09 GMT]]></title><description><![CDATA[<p>hoi Badestrand</p>
<p>ich denk mal wenn dann ueber basic_filebuf oder so.<br />
genaueres weiß ich leider auch nicht.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1601971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1601971</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Mon, 20 Oct 2008 23:58:09 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 05:06:09 GMT]]></title><description><![CDATA[<p><a href="http://cppreference.com/wiki/io/flags" rel="nofollow">http://cppreference.com/wiki/io/flags</a></p>
<p>Gehts hiermit nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1601985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1601985</guid><dc:creator><![CDATA[scorcher24@arbyte]]></dc:creator><pubDate>Tue, 21 Oct 2008 05:06:09 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 05:39:04 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;fstream&gt;

std::ifstream FileTest(&quot;testdatei.txt&quot;);
if(!FileTest)
     std::cout &lt;&lt; &quot;File not found.&quot; &lt;&lt; std::endl;
</code></pre>
<p>meinst du sowas hier? Könnte auch mit open klappen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1601992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1601992</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 21 Oct 2008 05:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 08:53:45 GMT]]></title><description><![CDATA[<p>Soweit ich das sehe, bekommst du das nachträglich nicht mehr raus. Mögliche Lösungen:</p>
<p>- open_mode irgendwo global speichern<br />
- Wrapper für deinen stream bauen<br />
- eigenen Stream bauen (etwas ähnliches hat Werner Salomon mal (vor)gemacht: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-219803-and-highlight-is-stream+bin%E4r.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-219803-and-highlight-is-stream+bin%E4r.html</a>)</p>
<p>HTH</p>
<p>EDIT: zu 3) : &lt;&lt; / &gt;&gt; entsprechend open_mode definieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602063</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Tue, 21 Oct 2008 08:53:45 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 08:59:33 GMT]]></title><description><![CDATA[<p>Na gut, danke. Mit flags geht's leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602070</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Tue, 21 Oct 2008 08:59:33 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 11:07:26 GMT]]></title><description><![CDATA[<p>Hab jetzt auch nichts gefunden. Würde zumindest gehen wenn man den Stream verändert. Eine 4 (int) reinschreiben (oder was auch immer für eine Zahl) und binär als char wieder einlesen und schauen ob es eine '4' ist (Text) oder nicht (binär). Ist aber eine ziemlich unsaubere und unpraktikable Methode.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602141</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 21 Oct 2008 11:07:26 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 11:40:06 GMT]]></title><description><![CDATA[<p>Wäre das nicht ein Verbesserungsvorschlag für C++0x? Noch ist C++0x nicht verabschiedet.<br />
Übrigens, es ist diesen Monat ein neuer C++0x-Draft raus gekommen:<br />
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602159</guid><dc:creator><![CDATA[Bulli]]></dc:creator><pubDate>Tue, 21 Oct 2008 11:40:06 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 11:50:11 GMT]]></title><description><![CDATA[<p>Fellhuhn schrieb:</p>
<blockquote>
<p>Hab jetzt auch nichts gefunden. Würde zumindest gehen wenn man den Stream verändert. Eine 4 (int) reinschreiben (oder was auch immer für eine Zahl) und binär als char wieder einlesen und schauen ob es eine '4' ist (Text) oder nicht (binär).</p>
</blockquote>
<p>Ich wage zu bezweifeln, dass Du, wenn Du eine 4 schreibst, eine 52 zurückbekommst. Egal ob binär oder nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602163</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602163</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 21 Oct 2008 11:50:11 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 12:17:09 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>Fellhuhn schrieb:</p>
<blockquote>
<p>Hab jetzt auch nichts gefunden. Würde zumindest gehen wenn man den Stream verändert. Eine 4 (int) reinschreiben (oder was auch immer für eine Zahl) und binär als char wieder einlesen und schauen ob es eine '4' ist (Text) oder nicht (binär).</p>
</blockquote>
<p>Ich wage zu bezweifeln, dass Du, wenn Du eine 4 schreibst, eine 52 zurückbekommst. Egal ob binär oder nicht.</p>
</blockquote>
<p>Eigentlich bekomm ich immer 52 zurück. Komisch. Ich hätte eigentlich erwartet, das wenn ich einen int binär rausschreibe ich mehr als 1 Byte belege...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602179</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602179</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 21 Oct 2008 12:17:09 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 12:20:02 GMT]]></title><description><![CDATA[<p>Vielleicht bedeutet ios::binary nicht das, was du denkst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602181</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 21 Oct 2008 12:20:02 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 12:22:44 GMT]]></title><description><![CDATA[<p>Vermutlich. Hm, also sind Streams gar nicht in der Lage &quot;richtig&quot; binär zu schreiben? Doof.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602185</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 21 Oct 2008 12:22:44 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 12:25:08 GMT]]></title><description><![CDATA[<p>Natürlich kannst Du in Streams richtig binär schreiben, vgl. dazu ostream::write vs. operator&lt;&lt;(ostream&amp;) (genau wie in Standard-C fwrite vs. fprintf).</p>
<p>Der Unterschied binär/text beim Openmode ist allerdings nur relevant im Bezug auf die Zeilenenden. Ein ofs &lt;&lt; &quot;\n&quot; schreibt unter Windows im Textmodus z.B. zwei Bytes (\r\n), im Binärmodus jedoch nur eins.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1602188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602188</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 21 Oct 2008 12:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to Herausfinden, ob fstream mit ios_base::binary geöffnet wurde on Tue, 21 Oct 2008 12:27:52 GMT]]></title><description><![CDATA[<p>Also geht es dem TE hier auch nur um das olle Zeilenende? Narf... <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1602190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1602190</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 21 Oct 2008 12:27:52 GMT</pubDate></item></channel></rss>