<?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[Datei Attribute !]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will die DateiAttribut mit SetFileTime ändern!</p>
<p>Hier mein Bsp!</p>
<pre><code class="language-cpp">FILETIME ft, ftCreate, ftAccess, ftWrite;
SYSTEMTIME st, stlocalcr,stlocalac,stlocalwr;
 BOOL bOK;
WIN32_FIND_DATA fileData, fileDataafter;
HANDLE          hSearch , Searchafter;

DCString strSuch = m_strZielPfad+ &quot;\\&quot; + strFilename + &quot;.&quot; +       m_strPCDateiErweiterung;

hSearch = ::FindFirstFile(strSuch , &amp;fileData );

if (hSearch != INVALID_HANDLE_VALUE)
{	
   GetSystemTime(&amp;st);              // Aktuelle Zeit holen
   SystemTimeToFileTime(&amp;st, &amp;ft);  // Konvertieren von Systemzeit nach Filezeit

  bOK = SetFileTime(hSearch,&amp;ft,&amp;ft ,&amp;ft);

}

::FindClose(hSearch);

   return bOK;
}
</code></pre>
<p>Aber es geht was schief!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/70176/datei-attribute</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 08:20:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/70176.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Apr 2004 07:56:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:26:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will die DateiAttribut mit SetFileTime ändern!</p>
<p>Hier mein Bsp!</p>
<pre><code class="language-cpp">FILETIME ft, ftCreate, ftAccess, ftWrite;
SYSTEMTIME st, stlocalcr,stlocalac,stlocalwr;
 BOOL bOK;
WIN32_FIND_DATA fileData, fileDataafter;
HANDLE          hSearch , Searchafter;

DCString strSuch = m_strZielPfad+ &quot;\\&quot; + strFilename + &quot;.&quot; +       m_strPCDateiErweiterung;

hSearch = ::FindFirstFile(strSuch , &amp;fileData );

if (hSearch != INVALID_HANDLE_VALUE)
{	
   GetSystemTime(&amp;st);              // Aktuelle Zeit holen
   SystemTimeToFileTime(&amp;st, &amp;ft);  // Konvertieren von Systemzeit nach Filezeit

  bOK = SetFileTime(hSearch,&amp;ft,&amp;ft ,&amp;ft);

}

::FindClose(hSearch);

   return bOK;
}
</code></pre>
<p>Aber es geht was schief!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495155</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:26:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 08:50:10 GMT]]></title><description><![CDATA[<p>Die Zeit, als die Datei das letzte mal gelesen wurde, würde ich sowieso nicht ändern. Das ist Sache von Windows. Außerdem musst du die Datei natürlich vorher öffnen, etwa so:</p>
<pre><code class="language-cpp">HANDLE hFile;
hFile=CreateFile(fileData.cFileName,GENERIC_WRITE,0,NULL,OPEN_EXISTING,NULL,NULL);
</code></pre>
<p>Du kannst nicht den Searchhandle als Dateihandle angeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495182</guid><dc:creator><![CDATA[unzi]]></dc:creator><pubDate>Mon, 05 Apr 2004 08:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 10:12:21 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/setfileattributes.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/setfileattributes.asp</a><br />
mach es doch so, dafür brauchst du keinen handle nur den dateinamen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495238</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 05 Apr 2004 10:12:21 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 11:02:21 GMT]]></title><description><![CDATA[<p>unzi schrieb:</p>
<blockquote>
<p>Die Zeit, als die Datei das letzte mal gelesen wurde, würde ich sowieso nicht ändern. Das ist Sache von Windows. Außerdem musst du die Datei natürlich vorher öffnen, etwa so:</p>
<pre><code class="language-cpp">HANDLE hFile;
hFile=CreateFile(fileData.cFileName,GENERIC_WRITE,0,NULL,OPEN_EXISTING,NULL,NULL);
</code></pre>
<p>Du kannst nicht den Searchhandle als Dateihandle angeben.</p>
</blockquote>
<p>Hintergrund ich will die letzte der Dateien löschen, will aber dabei beachten ob eine Datei vielleicht vorher nochmal geöffnet worden ist! Und bei dieser Datei die Zeit verändern!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495274</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 11:02:21 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 11:10:11 GMT]]></title><description><![CDATA[<p>Wholesaler schrieb:</p>
<blockquote>
<p>Hintergrund ich will die letzte der Dateien löschen, will aber dabei beachten ob eine Datei vielleicht vorher nochmal geöffnet worden ist! Und bei dieser Datei die Zeit verändern!</p>
</blockquote>
<p>die letzte von was <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> verzeichnissbaum? datum? ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495280</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 05 Apr 2004 11:10:11 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 11:19:00 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p>Wholesaler schrieb:</p>
<blockquote>
<p>Hintergrund ich will die letzte der Dateien löschen, will aber dabei beachten ob eine Datei vielleicht vorher nochmal geöffnet worden ist! Und bei dieser Datei die Zeit verändern!</p>
</blockquote>
<p>die letzte von was <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> verzeichnissbaum? datum? ...</p>
</blockquote>
<p>Also sagen wir mal ich habe 5 Dateien</p>
<p>Datei_1 05.04.2004 10 Uhr 11<br />
Datei_2 05.04.2004 10 Uhr 12<br />
Datei_3 05.04.2004 10 Uhr 13<br />
Datei_4 05.04.2004 10 Uhr 14<br />
Datei_5 05.04.2004 10 Uhr 15</p>
<p>Jetzt soll die älteste gelöscht werden! Ist Datei_1 !<br />
Jetzt wird datei_1 zwischenzeitlich geladen, angepackt ....</p>
<p>Ich will die Zeit der Datei ändern!<br />
Jetzt Datei_1 05.04.2004 11 Uhr 50 Es soll jetzt wieder die älteste gelöscht werden! Das wäre in dem fall nun Datei_2 05.04.2004 10 Uhr 12!</p>
<p>Gibt es dafür ein Bsp?</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495291</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 11:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 11:43:31 GMT]]></title><description><![CDATA[<p>Wholesaler schrieb:</p>
<blockquote>
<p>Jetzt wird datei_1 zwischenzeitlich geladen, angepackt ....</p>
</blockquote>
<p>ich glaube dieser fall ist sehr sehr unwahrscheinlch. das dieser fall in einer riesigen schleife (oder rekursion) ausarten würde.</p>
<p>ich würde es so machen:<br />
- alle dateien in eine liste laden (std::list, array oder irgendwiesowas)<br />
- sortieren nach datum<br />
- letzter eintrag ist das file das gelöscht werden soll</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495315</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 05 Apr 2004 11:43:31 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:20:35 GMT]]></title><description><![CDATA[<p>Hi ja genau das tue ich ja!</p>
<p>Ich lade alle Dateien in ein array und habe mir ein Sortiertemplat gebastelt!</p>
<p>Das Problem ist nur wie änder ich die Zeit!</p>
<p>DCString strSuch = m_strZielPfad+ &quot;\&quot; + strFilename + &quot;.&quot; + m_strPCDateiErweiterung;</p>
<p>hSearch = ::FindFirstFile(strSuch , &amp;fileData );</p>
<p>if (hSearch != INVALID_HANDLE_VALUE)<br />
{<br />
GetSystemTime(&amp;st); // Aktuelle Zeit holen<br />
SystemTimeToFileTime(&amp;st, &amp;ft);<br />
// Konvertieren von Systemzeit nach Filezeit</p>
<p>bOK = SetFileTime(hSearch,&amp;ft,&amp;ft ,&amp;ft);</p>
<p>bOK = GetFileTime(hSearch, &amp;ftCreate, &amp;ftAccess, &amp;ftWrite);</p>
<p>FileTimeToSystemTime(&amp;ftCreate, &amp;stlocalcr);<br />
FileTimeToSystemTime(&amp;ftAccess, &amp;stlocalac);<br />
FileTimeToSystemTime(&amp;ftWrite, &amp;stlocalwr);<br />
}</p>
<p>::FindClose(hSearch);</p>
<p>so geht es jedenfalls nicht!</p>
<p>/////////////////////////////////////////////<br />
Hast du viellicht ein komplettes Beispiel!<br />
Wie ich das Handle richtig aufbaue?</p>
<p>Das Handle um FILETIME ftCreate, ftAccess, ftWrite;<br />
(Create;Access und write Time zu ändern!!!)<br />
/////////////////////////////////////</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495357</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:20:35 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:33:02 GMT]]></title><description><![CDATA[<p>wie unzi schon gesagt hat, du brauchst einen filehandle. mit dem searchhandle geht das nicht.</p>
<pre><code class="language-cpp">if (hSearch != INVALID_HANDLE_VALUE) 
{ 
GetSystemTime(&amp;st); // Aktuelle Zeit holen 
SystemTimeToFileTime(&amp;st, &amp;ft); 
// Konvertieren von Systemzeit nach Filezeit 

// datei öffnen wie unzi vorgeschlagen hat
// hFile = CreateFile(...
bOK = SetFileTime(hFile,&amp;ft,&amp;ft ,&amp;ft); 

CloseHandle(hFile);

// und weiter gehts
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/495401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495401</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:33:02 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:40:41 GMT]]></title><description><![CDATA[<p>Also zuerst suchen dann neues Öffnen Handle Time ändern und schliessen!</p>
<p>Ich versuch das einfach mal!</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495413</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495413</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:50:14 GMT]]></title><description><![CDATA[<p>Aus deien Beschreibungen geht irgendwie nicht hervor, warum du die Zugriffszeit jetzt überhaupt ändern willst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /><br />
BTW: Die &quot;File-Zeiten&quot; sind eigentlich keine Attribute <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/495432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495432</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 12:56:18 GMT]]></title><description><![CDATA[<p>flenders schrieb:</p>
<blockquote>
<p>Aus deien Beschreibungen geht irgendwie nicht hervor, warum du die Zugriffszeit jetzt überhaupt ändern willst</p>
</blockquote>
<p>er wird schon seine gründe haben <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/495443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495443</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 05 Apr 2004 12:56:18 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:17:45 GMT]]></title><description><![CDATA[<p>so habe es mal so versucht!<br />
Ging in die Hose!</p>
<p>if (hSearch != INVALID_HANDLE_VALUE)<br />
{<br />
GetSystemTime(&amp;st); // Aktuelle Zeit holen<br />
SystemTimeToFileTime(&amp;st, &amp;ft); Filezeit</p>
<p>HANDLE hFile;<br />
DCString strFilekpl = m_strZielPfad + fileData.cFileName;<br />
hFile=CreateFile(strFilekpl,GENERIC_WRITE,0,NULL,OPEN_EXISTING,NULL,NULL);</p>
<p>bOK = SetFileTime(hFile,&amp;ft,&amp;ft ,&amp;ft);<br />
bOK = GetFileTime(hFile, &amp;ftCreate, &amp;ftAccess, &amp;ftWrite);</p>
<p>FileTimeToSystemTime(&amp;ftCreate, &amp;stlocalcr);<br />
FileTimeToSystemTime(&amp;ftAccess, &amp;stlocalac);<br />
FileTimeToSystemTime(&amp;ftWrite, &amp;stlocalwr);</p>
<p>CloseHandle(hFile);<br />
}</p>
<p>::FindClose(hSearch);</p>
<p>return bOK;</p>
<p>bOK ist jedesmal FALSE! (SetFileTime(hFile,&amp;ft,&amp;ft ,&amp;ft);)</p>
<p>Kannst du helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495469</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:24:58 GMT]]></title><description><![CDATA[<p>1.) Was ist ein DCString?<br />
2.) Was steht in strFilekpl - ist der Pfad richtig?<br />
3.) Was liefert CreateFile zurück und was sagt ggf. GetLastError?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495476</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:24:58 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:31:19 GMT]]></title><description><![CDATA[<p>flenders schrieb:</p>
<blockquote>
<p>1.) Was ist ein DCString?<br />
2.) Was steht in strFilekpl - ist der Pfad richtig?<br />
3.) Was liefert CreateFile zurück und was sagt ggf. GetLastError?</p>
</blockquote>
<p>zu 1 CSTring<br />
zu 2 strFilekpl = Zielpfad(\Program Files\Test\) + Dateiname + jpg<br />
zu 3 CreateFile liefert Handle hfile zurück! GetLastError muss ich debuggen!</p>
<p>Woran könnte es liegen? Oder hast du eine Idee wie ich das besser machen kann?</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495481</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:31:19 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:34:22 GMT]]></title><description><![CDATA[<p>Wholesaler schrieb:</p>
<blockquote>
<p>flenders schrieb:</p>
<blockquote>
<p>1.) Was ist ein DCString?<br />
2.) Was steht in strFilekpl - ist der Pfad richtig?<br />
3.) Was liefert CreateFile zurück und was sagt ggf. GetLastError?</p>
</blockquote>
<p>zu 1 CSTring<br />
zu 2 strFilekpl = Zielpfad(\Program Files\Test\) + Dateiname + jpg<br />
zu 3 CreateFile liefert Handle hfile zurück! GetLastError muss ich debuggen!</p>
<p>Woran könnte es liegen? Oder hast du eine Idee wie ich das besser machen kann?</p>
<p>Gruss</p>
</blockquote>
<p>GetLastError liefert mir 2 zurück!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495487</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:38:17 GMT]]></title><description><![CDATA[<p>Wholesaler schrieb:</p>
<blockquote>
<p>flenders schrieb:</p>
<blockquote>
<p>1.) Was ist ein DCString?<br />
2.) Was steht in strFilekpl - ist der Pfad richtig?<br />
3.) Was liefert CreateFile zurück und was sagt ggf. GetLastError?</p>
</blockquote>
<p>zu 1 CSTring<br />
zu 2 strFilekpl = Zielpfad(\Program Files\Test\) + Dateiname + jpg<br />
zu 3 CreateFile liefert Handle hfile zurück! GetLastError muss ich debuggen!</p>
<p>Woran könnte es liegen? Oder hast du eine Idee wie ich das besser machen kann?</p>
<p>Gruss</p>
</blockquote>
<p>Es scheint an createFile zu liegen! Stimmt etwas mit den Parametern nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495495</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:38:17 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 13:53:35 GMT]]></title><description><![CDATA[<p>Was _genau_ steht denn jetzt in strFilekpl drin - hast du dir das mal direkt ausgeben lassen?<br />
Bzw. hast du mal ausprobiert, ob es klappt, wenn du den Pfad entsprechen direkt angibst?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495514</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 05 Apr 2004 13:53:35 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Attribute ! on Mon, 05 Apr 2004 14:19:57 GMT]]></title><description><![CDATA[<p>So habe den Fehler gefunden!</p>
<p>Beim zusammen bau des Pfades habe ich \\ ein backslash vergessen! ;-)))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/495538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/495538</guid><dc:creator><![CDATA[Wholesaler]]></dc:creator><pubDate>Mon, 05 Apr 2004 14:19:57 GMT</pubDate></item></channel></rss>