<?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[SetFileAttributes() und FileSetAttr()]]></title><description><![CDATA[<p>Hat jemand eine Idee, warum beide Zeilen nicht funktionieren?</p>
<pre><code>SetFileAttributes(&quot;C:\MyFolder\MySubFolder\MyVid.avi&quot;, FILE_ATTRIBUTE_READONLY);
</code></pre>
<pre><code>FileSetAttr(&quot;C:\MyFolder\MySubFolder\MyVid.avi&quot;, faReadOnly);
</code></pre>
<p>Die Parameter sind denke ich richtig gefüllt, der Compiler meckert nicht.</p>
<p>Die Datei existiert, Schreibfehler können ausgeschlossen werden.</p>
<p>Trotzdem ist die Datei &quot;MyVid.avi&quot; hinterher nicht schreibgeschützt.</p>
<p>Hab keine Idee, warum das nicht funktioniert.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/168506/setfileattributes-und-filesetattr</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 11:59:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/168506.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Dec 2006 14:46:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SetFileAttributes() und FileSetAttr() on Sat, 23 Dec 2006 14:48:06 GMT]]></title><description><![CDATA[<p>Hat jemand eine Idee, warum beide Zeilen nicht funktionieren?</p>
<pre><code>SetFileAttributes(&quot;C:\MyFolder\MySubFolder\MyVid.avi&quot;, FILE_ATTRIBUTE_READONLY);
</code></pre>
<pre><code>FileSetAttr(&quot;C:\MyFolder\MySubFolder\MyVid.avi&quot;, faReadOnly);
</code></pre>
<p>Die Parameter sind denke ich richtig gefüllt, der Compiler meckert nicht.</p>
<p>Die Datei existiert, Schreibfehler können ausgeschlossen werden.</p>
<p>Trotzdem ist die Datei &quot;MyVid.avi&quot; hinterher nicht schreibgeschützt.</p>
<p>Hab keine Idee, warum das nicht funktioniert.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197010</guid><dc:creator><![CDATA[dust]]></dc:creator><pubDate>Sat, 23 Dec 2006 14:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to SetFileAttributes() und FileSetAttr() on Sat, 23 Dec 2006 16:38:45 GMT]]></title><description><![CDATA[<p>Da du wirklich einen \ verwenden willst musst du \\ benutzen:</p>
<pre><code class="language-cpp">SetFileAttributes(&quot;C:\\MyFolder\\MySubFolder\\MyVid.avi&quot;, FILE_ATTRIBUTE_READONLY);
</code></pre>
<pre><code class="language-cpp">FileSetAttr(&quot;C:\\MyFolder\\MySubFolder\\MyVid.avi&quot;, faReadOnly);
</code></pre>
<p>Ansonsten könntest du mit <strong>GetLastError</strong> versuchen eine genauere Fehlermeldung zu bekommen. (<a href="http://www.mpdvc.de/html.htm#Q94" rel="nofollow">http://www.mpdvc.de/html.htm#Q94</a>)</p>
<p>In deinem Fall würde so etwas kommen:</p>
<blockquote>
<p>Das System kann die angegebene Datei nicht finden.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1197043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197043</guid><dc:creator><![CDATA[Barracuda]]></dc:creator><pubDate>Sat, 23 Dec 2006 16:38:45 GMT</pubDate></item><item><title><![CDATA[Reply to SetFileAttributes() und FileSetAttr() on Sat, 23 Dec 2006 18:11:40 GMT]]></title><description><![CDATA[<p>Ach klar, da hätte ich auch selber drauf kommen können. Hatte mir dazu 'nen VB-Beispiel angeguckt, da hat man das Problem ja nicht. Danke bis hier hin, eine einzelne Datei (deren Attribute) kann ich jetzt manipulieren, aber ursprünglich wollte ich einen ganzen Ordner Schreibgeschützt machen. Und das funktioniert immer noch nicht:</p>
<pre><code>SetFileAttributes(&quot;C:\\MyFolder&quot;, FILE_ATTRIBUTE_READONLY);
</code></pre>
<p>bzw.:</p>
<pre><code>FileSetAttr(&quot;C:\\MyFolder&quot;, faReadOnly);
</code></pre>
<p>Bitte sagt mir nicht, dass der Ordner dazu leer sein muss!</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197082</guid><dc:creator><![CDATA[dust]]></dc:creator><pubDate>Sat, 23 Dec 2006 18:11:40 GMT</pubDate></item><item><title><![CDATA[Reply to SetFileAttributes() und FileSetAttr() on Sat, 23 Dec 2006 19:04:34 GMT]]></title><description><![CDATA[<p>&quot;Funktioniert nicht&quot; ist keine Fehler- oder Problembeschreibung!</p>
<p>Unter Windows XP wird das ReadOnly-Attribut bei Ordnern generell ignoriert. Probiere deinen Code z.B. mal mit faHidden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197111</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sat, 23 Dec 2006 19:04:34 GMT</pubDate></item><item><title><![CDATA[Reply to SetFileAttributes() und FileSetAttr() on Sun, 24 Dec 2006 13:55:49 GMT]]></title><description><![CDATA[<blockquote>
<p>&quot;Funktioniert nicht&quot; ist keine Fehler- oder Problembeschreibung!</p>
</blockquote>
<p>Das hat auch niemand behauptet!</p>
<p>Du hast Recht, faHidden funktioniert. Was mach ich denn jetzt, wenn ich den Ordner schreibgeschützt machen will? Versteh ich net, warum WinXP das bei Ordnern ignoriert. Muss ich erst irgendwelche Privilegien holen oder was?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197396</guid><dc:creator><![CDATA[dust]]></dc:creator><pubDate>Sun, 24 Dec 2006 13:55:49 GMT</pubDate></item></channel></rss>