<?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[Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig)]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine plattformunabhängige Methode IsWriteable(directory) implementieren. Sie sollte auf Windows und Unix funktionieren, kann intern auch plattformspezifischen Code enthalten.</p>
<p>In dieser Methode will ich nicht testweise eine Datei erzeugen, sondern Betriebssystemfunktionen nutzen.</p>
<p>Hat jemand einen Vorschlag?</p>
<p>P.S.: habe schon gesucht, habe aber kein passendes Beispiel gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/296323/testen-ob-verzeichnis-beschreibbar-ist-plattformunabhängig</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 01:12:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/296323.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Dec 2011 11:39:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 11:39:05 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine plattformunabhängige Methode IsWriteable(directory) implementieren. Sie sollte auf Windows und Unix funktionieren, kann intern auch plattformspezifischen Code enthalten.</p>
<p>In dieser Methode will ich nicht testweise eine Datei erzeugen, sondern Betriebssystemfunktionen nutzen.</p>
<p>Hat jemand einen Vorschlag?</p>
<p>P.S.: habe schon gesucht, habe aber kein passendes Beispiel gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2151892</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2151892</guid><dc:creator><![CDATA[Sebastian Meier]]></dc:creator><pubDate>Fri, 02 Dec 2011 11:39:05 GMT</pubDate></item><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 11:50:02 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool IsWriteable(const char* directory)
{
#if defined _WIN32
  //windows-code
#elif defined UNIX
  //POSIX-code
#else
# error bla
}
</code></pre>
<p>oder fehlt es dir an den api-funktionen?</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2151903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2151903</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 02 Dec 2011 11:50:02 GMT</pubDate></item><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 12:06:25 GMT]]></title><description><![CDATA[<p>GetFileAttributes() mit &quot;Windows.h&quot; für Windows und stat() zusammen mit &lt;sys/stat.h&gt; für Linux</p>
<p>Sebastian Meier schrieb:</p>
<blockquote>
<p>P.S.: habe schon gesucht, habe aber kein passendes Beispiel gefunden.</p>
</blockquote>
<p>Glaub ich dir kein Wort.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2151914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2151914</guid><dc:creator><![CDATA[*Rewind*]]></dc:creator><pubDate>Fri, 02 Dec 2011 12:06:25 GMT</pubDate></item><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 14:10:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16305">@unskilled</a>: ja, die API-Funktionen suche ich</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/22303">@Rewind</a>: GetFileAttributes() - geht das für Verzeichnisse? Aus der Doku:</p>
<blockquote>
<p>FILE_ATTRIBUTE_READONLY</p>
<p>A file that is read-only. Applications can read the file, but cannot write to it or delete it. <strong>This attribute is not honored on directories.</strong></p>
</blockquote>
<p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2151959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2151959</guid><dc:creator><![CDATA[Sebastian Meier]]></dc:creator><pubDate>Fri, 02 Dec 2011 14:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 15:30:33 GMT]]></title><description><![CDATA[<p>Das wird wahrscheinlich damit zusammenhängen, dass man auf Windows keine Ordner als &quot;read-only&quot; (im Sinne von <code>chmod a-w</code> bei Linux) einstellen kann, bin mir aber nicht sicher, ob das bei WinXP noch ging. Ich lasse mich aber gerne eines besseren belehren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2151996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2151996</guid><dc:creator><![CDATA[*Rewind*]]></dc:creator><pubDate>Fri, 02 Dec 2011 15:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to Testen, ob Verzeichnis beschreibbar ist (plattformunabhängig) on Fri, 02 Dec 2011 16:28:08 GMT]]></title><description><![CDATA[<p>Nur auf read-only zu testen reicht ja nicht. Bei Windows müsste man eigentlich die ACL auslesen und darüber die Rechte bestimmen. Das ist nicht gerade trivial.<br />
Es ist schon am Einfachsten einfach zu versuchen was zu schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152004</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152004</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 02 Dec 2011 16:28:08 GMT</pubDate></item></channel></rss>