Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 06.07.08 11:48 
Hallo.

Ich habe im Kopf, dass man Dateien irgendwie als temporäre Dateien markieren kann. Wie ging das denn nochmal?
Oder täusche ich mich da?

Danke,
Matze

_________________
In the beginning was the word.
And the word was content-type: text/plain.
1aa
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47
Erhaltene Danke: 1

Win Vista, Win8
Delphi 2007
BeitragVerfasst: So 06.07.08 12:11 
als endung einfach ".tmp" eingeben
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 06.07.08 12:12 
Beim Aufruf von CreateFile den Falgs FILE_ATTRIBUTE_TEMPORARY und FILE_FLAG_DELETE_ON_CLOSE mit übergeben. Beachte, dass die Datei dann automatisch von Windows bei einem CloseHandle gelöscht wird.

Siehe msdn.microsoft.com/e...aa363875(VS.85).aspx und msdn.microsoft.com/e...aa363858(VS.85).aspx

@user profile icon1aa: Warum dem User den Dreck dalassen, wenn die WinAPI gleich auch sauber machen kann???

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 06.07.08 18:54 
Ich dachte, dass man das auch im Nachhinein noch machen kann. Irgendwie mit FileSetAttr oder so.

@user profile iconBenBE:Aber danke schon mal an die Lösung.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 06.07.08 20:55 
Das ist IMHO etwas unlogisch, da der Witz an dem Temporär-Attribut ja grad ist "Lösch mich, wenn ich dich schließe". Wenn also die Datei geschlossen ist, müsste damit als logische Konsequenz das Setzen dieses Attributes einem DeleteFile gleichkommen. In jedem Fall ist das Attribut Temporary aber ein virtuelles Attribut, d.h. es wird AFAIK nirgends auf Platte geschrieben.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 07.07.08 08:27 
ah ok. Alles klar.

Vielen Dank für die Hilfe!

_________________
In the beginning was the word.
And the word was content-type: text/plain.