<?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[Ordner erstellen]]></title><description><![CDATA[<p>Es geht um folgendes. Ich möchte ein Objekt in eine Datei schreiben. Wenn man einen Pfad angibt, bei dem Ordner vorkommen, die (noch) nicht existieren, solle diese erstellt werden. Wichtig ist, dass das ganze Platform-unabhängigkeit ist. Gibt es da eine einfache Möglichkeit?</p>
<pre><code class="language-cpp">template &lt;class T&gt;
void Matrix&lt;T&gt;::write(const char* path) const {
	fstream f;
	f.open(path, ios::out);
	if (!f) { /* ... */ }
	f &lt;&lt; *this;
	f.close();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/304288/ordner-erstellen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 21:02:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304288.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 Jun 2012 18:57:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 18:57:27 GMT]]></title><description><![CDATA[<p>Es geht um folgendes. Ich möchte ein Objekt in eine Datei schreiben. Wenn man einen Pfad angibt, bei dem Ordner vorkommen, die (noch) nicht existieren, solle diese erstellt werden. Wichtig ist, dass das ganze Platform-unabhängigkeit ist. Gibt es da eine einfache Möglichkeit?</p>
<pre><code class="language-cpp">template &lt;class T&gt;
void Matrix&lt;T&gt;::write(const char* path) const {
	fstream f;
	f.open(path, ios::out);
	if (!f) { /* ... */ }
	f &lt;&lt; *this;
	f.close();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2218619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218619</guid><dc:creator><![CDATA[Ramanujan]]></dc:creator><pubDate>Sat, 02 Jun 2012 18:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 18:59:03 GMT]]></title><description><![CDATA[<p>Ramanujan schrieb:</p>
<blockquote>
<p>Wenn man einen Pfad angibt, bei dem Ordner vorkommen, die (noch) nicht existieren, solle diese erstellt werden. Wichtig ist, dass das ganze Platform-unabhängigkeit ist. Gibt es da eine einfache Möglichkeit?</p>
</blockquote>
<p>Ganz Allgemein: Nein, die Standardlibrary bietet afaik (noch) keine derartigen Möglichkeiten.</p>
<p>Schau dir z.B. mal Boost.Filesystem an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2218620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218620</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Sat, 02 Jun 2012 18:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 19:06:11 GMT]]></title><description><![CDATA[<p>Da es nur ein kleines, nicht notwendiges Feature sein soll, ist mir der Aufwand zu hoch, Boost zu installieren, auf wenn Boost sicher noch viele andere Nützlichkeiten bietet.</p>
<p>Gibt es ernsthaft keine Möglichkeit mit der Standardlibrary Ordner zu erstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2218623</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218623</guid><dc:creator><![CDATA[Ramanujan]]></dc:creator><pubDate>Sat, 02 Jun 2012 19:06:11 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 19:09:43 GMT]]></title><description><![CDATA[<p>Nicht jede Plattform, auf der es C++ gibt, muss sowas wie &quot;Ordner&quot; überhaupt kennen. Daher ist sowas auch nicht Teil des Sprachstandards...</p>
<p>Verwend eben die jeweilige API der jeweiligen Plattform. Unter Windows wäre das z.B. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363855.aspx" rel="nofollow">CreateDirectory()</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2218625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218625</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Sat, 02 Jun 2012 19:09:43 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 19:14:25 GMT]]></title><description><![CDATA[<p>Dann kann ich auch mit &quot;nicht jede Platform muss Dateien haben&quot; argumentieren^^</p>
<p>Aber ich sag mal so: Wenn man einen Ordner erstellen könnte, weiß man immer noch nicht, wie man nun in der Ordnerstruktur navigiert, also z.B. ob Ornder durch &quot;/&quot; oder &quot;\&quot; getrennt sind.</p>
<p>Naja, dann muss man halt die Ordner vorher per Hand erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2218628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218628</guid><dc:creator><![CDATA[Ramanujan]]></dc:creator><pubDate>Sat, 02 Jun 2012 19:14:25 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner erstellen on Sat, 02 Jun 2012 19:18:29 GMT]]></title><description><![CDATA[<p>Ramanujan schrieb:</p>
<blockquote>
<p>Dann kann ich auch mit &quot;nicht jede Platform muss Dateien haben&quot; argumentieren^^</p>
</blockquote>
<p>Die Existenz von &quot;Dateien&quot; ist völlig unabhängig von &quot;Ordnern&quot;. Ordner sind nur eine Möglichkeit wie Dateien in einem Dateisystem organisiert sein können...</p>
<p>Ramanujan schrieb:</p>
<blockquote>
<p>Naja, dann muss man halt die Ordner vorher per Hand erstellen.</p>
</blockquote>
<p>Oder eben du benutzt die entsprechende API des jeweiligen OS...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2218629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2218629</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Sat, 02 Jun 2012 19:18:29 GMT</pubDate></item></channel></rss>