I needed to 'touch' a file in windows for a C header file, since CopyFile() does not change the timestamp.
I thought OpenFile() and CloseFile() would be enough, but .... nothing changed.
Than I tried to append an empty string with WriteString(), but this trick didn't work either.
But as usual there was a way:
Code: Select all
Procedure.i TouchFile(Filename$)
Protected File.i
File = OpenFile(#PB_Any, Filename$, #PB_File_Append)
If File
TruncateFile(File)
CloseFile(File)
EndIf
ProcedureReturn File
EndProcedure
Bernd