<?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[Stream verstecken]]></title><description><![CDATA[<p>Hallo<br />
ich brauche if und ofstream wie unten:</p>
<p>std::ofstream tfs;<br />
tfs.open(TmpFile, std::ios::out | std::ios::binary);<br />
...<br />
tfs.close();</p>
<p>std::ifstream ttfs;<br />
ttfs.open(TmpFile, std::ios::in | std::ios::binary);</p>
<p>while(getline(ttfs, Mtmp)){<br />
...</p>
<p>Könnte ich TmpFile irgendwie vor dem Anwender verstecken?<br />
Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/311385/stream-verstecken</link><generator>RSS for Node</generator><lastBuildDate>Mon, 03 Aug 2026 14:16:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/311385.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Dec 2012 11:00:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 11:00:31 GMT]]></title><description><![CDATA[<p>Hallo<br />
ich brauche if und ofstream wie unten:</p>
<p>std::ofstream tfs;<br />
tfs.open(TmpFile, std::ios::out | std::ios::binary);<br />
...<br />
tfs.close();</p>
<p>std::ifstream ttfs;<br />
ttfs.open(TmpFile, std::ios::in | std::ios::binary);</p>
<p>while(getline(ttfs, Mtmp)){<br />
...</p>
<p>Könnte ich TmpFile irgendwie vor dem Anwender verstecken?<br />
Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277043</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Tue, 04 Dec 2012 11:00:31 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 11:23:49 GMT]]></title><description><![CDATA[<p>Abstraktion durch Kapselung?</p>
<pre><code>class file_ostream
{
private:
 std::ofstream tfs;
public:
 file_ostream(const string&amp; TmpFile) : tfs(TmpFile.c_str(), std::ios::binary) {}
};
</code></pre>
<p>Jetzt musst du nur noch &quot;The Big Three&quot; beachten. Für ifstream gehts ja analog.</p>
<p>PS: Habs hier im Forum zusammengeschrieben, eventuelle Rechtschreibfehler usw.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277050</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Tue, 04 Dec 2012 11:23:49 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 11:28:16 GMT]]></title><description><![CDATA[<p>Sry, vergiß das mit &quot;The Big Three&quot;. Lass das open und close einfach RAII übernehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277052</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Tue, 04 Dec 2012 11:28:16 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 12:01:47 GMT]]></title><description><![CDATA[<p>Ich glaube, der Fragesteller meint vielmehr das File so zu verstecken, dass es der Anwender nicht findet, z.B. im Windows Explorer.</p>
<p>Das geht nur über OS spezifische APIs. Bei Windows kannst Du dem File das Hidden Attribute setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277058</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Tue, 04 Dec 2012 12:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 12:23:17 GMT]]></title><description><![CDATA[<p>Es sollte cross platform für den Anwender nicht auffindbar sein. Hmm ich habe es mit Klassen noch nicht so gut:</p>
<p>class file_ostream : ofstream<br />
{<br />
private:<br />
std::ofstream tfs;<br />
public:<br />
file_ostream(const string&amp; TmpFile) : tfs(TmpFile.c_str(), std::ios::out | std::ios::binary) {}<br />
};</p>
<p>class file_ifstream : ifstream<br />
{<br />
private:<br />
std::ifstream codedfs;<br />
public:<br />
file_ifstream(const string&amp; TmpFile) : codedfs(TmpFile.c_str(), std::ios::in | std::ios::binary) {}<br />
};</p>
<p>Dann in main:</p>
<p>file_ostream tfs(TmpFile);<br />
tfs.put(NewByte);</p>
<p>Damit bekomme ich foldende Fehler:<br />
Multiple markers at this line<br />
- ‘std::basic_ostream&lt;char&gt;’ is not an accessible base of<br />
‘file_ostream’</p>
<p>Vielen Dank für weitere Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277066</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Tue, 04 Dec 2012 12:23:17 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 12:28:04 GMT]]></title><description><![CDATA[<p>mike4 schrieb:</p>
<blockquote>
<p>Es sollte cross platform für den Anwender nicht auffindbar sein.</p>
</blockquote>
<p>Das wird schwierig, da das Konzept eines &quot;Versteckt&quot;-Attributes nur in Windows verbreitet ist.</p>
<p>Was hat die Frage mit deinem Code zu tun?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277067</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 04 Dec 2012 12:28:04 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 13:21:35 GMT]]></title><description><![CDATA[<p>Unter Windows kannst du die Datei nicht verstecken. Ein Benutzer mit ausreichenden Rechten und passenden Tools kann zu jedem Prozess auflisten, welche Ressourcen der Prozess benutzt, und dazu gehören nun auch einmal Dateien.<br />
Wenn der Dateiname (inkl. Pfad) frei wählbar ist kannst du ihn in dem Windows Ordnergewühl &quot;verstecken&quot;. Mit genügend vielen kryptischen Unterverzeichnissen unter &quot;c:\Dokumente und Einstellungen&quot; kann man selbst hart gesottene Schnüffler abschrecken :D.<br />
Für unversierte Benutzer reicht es wahrscheinlich schon, das &quot;Hidden&quot; Flag der Datei zu setzen und die Windows Explorer Optionen so einstellen, dass er keine versteckte Dateien mehr anzeigt. Das Verstecken einer Datei funktioniert mit der <code>SetFileAttributes</code> und dem Flag <code>FILE_ATTRIBUTE_HIDDEN</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277086</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Tue, 04 Dec 2012 13:21:35 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 13:25:37 GMT]]></title><description><![CDATA[<p>mike4 schrieb:</p>
<blockquote>
<p>Es sollte cross platform für den Anwender nicht auffindbar sein. Hmm ich habe es mit Klassen noch nicht so gut:</p>
<p>class file_ostream : ofstream<br />
{<br />
...</p>
<p>Damit bekomme ich folgende Fehler:<br />
Multiple markers at this line<br />
- ‘std::basic_ostream&lt;char&gt;’ is not an accessible base of<br />
‘file_ostream’</p>
</blockquote>
<pre><code>class file_ostream : public std::ofstream
{
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2277088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277088</guid><dc:creator><![CDATA[Publicer]]></dc:creator><pubDate>Tue, 04 Dec 2012 13:25:37 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Tue, 04 Dec 2012 14:07:42 GMT]]></title><description><![CDATA[<p>Es gibt ja auch noch das gute alte tmpfile: <a href="http://en.cppreference.com/w/cpp/io/c/tmpfile" rel="nofollow">http://en.cppreference.com/w/cpp/io/c/tmpfile</a> :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277093</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Tue, 04 Dec 2012 14:07:42 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 10:07:02 GMT]]></title><description><![CDATA[<p>Danke besonders out und publicer.</p>
<p>class file_ofstream : public std::ofstream<br />
{<br />
//private:<br />
std::ofstream ttfs;<br />
public:<br />
file_ofstream(const string&amp; TmpFile) : ttfs::open(TmpFile, std::ios::out | std::ios::binary) {}<br />
};</p>
<p>Damit bekomme ich:<br />
Multiple markers at this line<br />
- Symbol 'open' could not be resolved<br />
- ‘ttfs’ is not a class or namespace<br />
- expected ‘{’ before ‘open’</p>
<p>Wenn ich open weglasse, rsp. in main:<br />
file_ofstream ttfs(TmpFile);<br />
// tfs.open(TmpFile, std::ios::out | std::ios::binary);</p>
<p>habe ich ja dasselbe, der Clou liegt darin die Datei in der Klasse zu öffnen?<br />
Nochmals vielen Dank für die Klassengestaltung.</p>
<p>Danke auch cooky451, wenn Obiges nichts wird versuche ich deinen link.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277391</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Wed, 05 Dec 2012 10:07:02 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 11:02:43 GMT]]></title><description><![CDATA[<p>Hallo,<br />
nochmal zum mitschreiben. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>1. Leite nie von <code>ofstream</code> und <code>ifstream</code> ab. Das führt zu nichts. Bevorzuge immer <code>has-a</code> statt <code>is-a</code> Beziehung.<br />
2. Verwende die Funktionen <code>open</code> und <code>close</code> <strong>nicht</strong>. Nutze RAII aus!<br />
3. Das <code>o</code> in ofstream steht für output. Was solltest du anderes mit einem ofstream machen, als etwas auszugeben? Was ich sagen will, <code>std::ios::out</code> ist total überflüssig, es heist nicht umsonst <strong>o</strong>fstream. Analoges gilt für <code>ifstream</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277403</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277403</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Wed, 05 Dec 2012 11:02:43 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 12:21:15 GMT]]></title><description><![CDATA[<p>Jetzt bin ich völlig konfus...</p>
<p>class file_ifstream : public std::ifstream<br />
{<br />
//private:<br />
std::ifstream codedfs;<br />
public:<br />
file_ifstream(const string&amp; InFile1) : codedfs(InFile1.c_str(), std::ios::binary) {}<br />
};</p>
<p>file_ifstream codedfs(InFile1);<br />
while(!codedfs.eof())<br />
{</p>
<p>Die while schlaufe bricht gleich ab da die Datei nicht richtig eingelesen wurde.<br />
Ich möchte InFile1 ins memory einlesen, verändern(tmp unsichtbar) und mit einer anderen normalen ifstream Datei vergleichen.<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277428</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Wed, 05 Dec 2012 12:21:15 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 14:54:35 GMT]]></title><description><![CDATA[<p>Wieso zur Hölle willst du von den Streams erben? Was ist dein Ziel? Du verwirrst hier alle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277479</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Wed, 05 Dec 2012 14:54:35 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 16:51:01 GMT]]></title><description><![CDATA[<p>Na weil ich sowas wie unten brauche. Es funktioniert ja wenn ich ofstream tmp auf die Hd schreibe und wieder als ifstream öffne aber genau das will ich ja nicht.</p>
<p>while(!codedfs.eof())<br />
Byte = codedfs.get();<br />
tfs.close();<br />
etc.<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277545</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Wed, 05 Dec 2012 16:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 17:00:19 GMT]]></title><description><![CDATA[<p>Nur hat das was du da machst rein garnichts damit zu tun.</p>
<p>Sag doch mal WAS du erreichen möchtest und nicht wie du es erreichen möchtest.</p>
<p>Eimne Datei kannst du jedenfalls nicht für den Nutzer unsichtbar anlegen, das geht nicht, höchstens oberflächlich verstecken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277546</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277546</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Wed, 05 Dec 2012 17:00:19 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Wed, 05 Dec 2012 17:00:21 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/faq.php?mode=bbcode#0" rel="nofollow">BBCode-Hilfe: Was sind Codetags?</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277547</guid><dc:creator><![CDATA[kleinertipp]]></dc:creator><pubDate>Wed, 05 Dec 2012 17:00:21 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Thu, 06 Dec 2012 07:14:15 GMT]]></title><description><![CDATA[<p>Ethon schrieb:</p>
<blockquote>
<p>Nur hat das was du da machst rein garnichts damit zu tun.</p>
</blockquote>
<p>Du meinst du hast keine Ahnung?<br />
Na ich werde dann halt mal cooky451s Vorschlag probieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277669</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277669</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Thu, 06 Dec 2012 07:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Thu, 06 Dec 2012 08:29:15 GMT]]></title><description><![CDATA[<p>mike4 schrieb:</p>
<blockquote>
<p>Ethon schrieb:</p>
<blockquote>
<p>Nur hat das was du da machst rein garnichts damit zu tun.</p>
</blockquote>
<p>Du meinst du hast keine Ahnung?<br />
Na ich werde dann halt mal cooky451s Vorschlag probieren.</p>
</blockquote>
<p>Nein, du hast keine Ahnung.<br />
Du versteckst hier den Stream vor anderen Nutzern des Codes (den Tipp hast du bekommen, da du einige Poster verwirrt hast) und keine Datei vor Nutzern des Programms.</p>
<p>Bei cookys Vorschlag wird die Datei unter Linux unter /tmp mit nem Schrottnamen angelegt, unter Windows in den Pfad für temporäre Dateien.<br />
Wenn du ganz viel Glück hast wird bei kleinen Daten nie eine Datei angelegt und alles im RAM angelegt, aber darauf darfst du dich unter keinen Umständen verlassen, weiß nicht ob da irgendein OS eine entsprechende API anbietet.</p>
<p>Die einzige Möglichkeit eine Datei richtig zu verstecken ist das Schreiben eines modifizierten Festplatten-/Dateisystemtreibers oder eines Rootkits. Da Beides nicht in Frage kommt, schreib die Datei einfach nie auf die Platte und gut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277686</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Thu, 06 Dec 2012 08:29:15 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Thu, 06 Dec 2012 09:14:18 GMT]]></title><description><![CDATA[<p>Juhu damit scheint es zu klappen: stringstream</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277696</guid><dc:creator><![CDATA[mike4]]></dc:creator><pubDate>Thu, 06 Dec 2012 09:14:18 GMT</pubDate></item><item><title><![CDATA[Reply to Stream verstecken on Thu, 06 Dec 2012 19:07:48 GMT]]></title><description><![CDATA[<p>DocShoe schrieb:</p>
<blockquote>
<p>Unter Windows kannst du die Datei nicht verstecken. Ein Benutzer mit ausreichenden Rechten und passenden Tools kann zu jedem Prozess auflisten, welche Ressourcen der Prozess benutzt, und dazu gehören nun auch einmal Dateien.<br />
Wenn der Dateiname (inkl. Pfad) frei wählbar ist kannst du ihn in dem Windows Ordnergewühl &quot;verstecken&quot;. Mit genügend vielen kryptischen Unterverzeichnissen unter &quot;c:\Dokumente und Einstellungen&quot; kann man selbst hart gesottene Schnüffler abschrecken :D.<br />
Für unversierte Benutzer reicht es wahrscheinlich schon, das &quot;Hidden&quot; Flag der Datei zu setzen und die Windows Explorer Optionen so einstellen, dass er keine versteckte Dateien mehr anzeigt. Das Verstecken einer Datei funktioniert mit der <code>SetFileAttributes</code> und dem Flag <code>FILE_ATTRIBUTE_HIDDEN</code> .</p>
</blockquote>
<p>Du bist wohl einer von denen die Adminrechte für ihr Programm brauchen weil sie alles im Installationsordner spoeichern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2277926</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2277926</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Thu, 06 Dec 2012 19:07:48 GMT</pubDate></item></channel></rss>