Datum einer Datei setzen

Hi!

Gibt es unter VB eine Möglichkeit, das Datum der Datei bewußt zu setzen? Quasi das Gegenstück zu „FileDateTime“?

Danke + Grüße
Siegfried

Dafür gibts die API-Funktion SetFileTime().

Frag mich aber nicht, wie das mit der „FILETIME structure“ funktioniert…

Den Filehandle bekommst Du z.B. mit lopen()

greets from michL (vienna)

Hier die Declarationen:

Private Declare Function lopen Lib "kernel32" Alias "\_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function SetFileTime Lib "kernel32" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As Long
Private Type FILETIME
 dwLowDateTime As Long
 dwHighDateTime As Long
End Type