...das Datei-Datum (DOS-Mode) ändern?

Autor: Chris Botha
Homepage: http://www.pilot.co.za

Kategorie: Dateien

procedure TForm1.Button1Click(Sender: TObject);
var
  
OutFile: file;
  OutFileName: string;
  FileDateTime: TDateTime;
begin
  
//File which date & time stamp are to change...
  
OutFileName := 'c:\Test.txt';
  AssignFile(OutFile, OutFileName);
  Reset(OutFile);
  //Get file's current date & time stamp...
  
FileDateTime := FileDateToDateTime(FileAge(OutFileName));
  //Set file's date one day ahead!
  
FileSetDate(TFileRec(OutFile).Handle, DateTimeToFileDate(FileDateTime + 1));
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base