Sign in Join
FPDoc Onlineexperiment

FileGetDate function

In unit sysutils

Return the file time of an opened file.

Declaration

pascal
function FileGetDate(Handle: THandle): Int64

Description

FileGetdate returns the filetime of the opened file with file handle Handle. It is the same as FileAge, with this difference that FileAge only needs the file name, while FilegetDate needs an open file handle.

Errors

On error, -1 is returned.

See also

Example: ex39

pascal
Program Example39;

{ This program demonstrates the FileGetDate function }

Uses sysutils;

Var F,D : Longint;

Begin
  F:=FileCreate('test.dat');
  D:=FileGetDate(F);
  Writeln ('File created on ',DateTimeToStr(FileDateToDateTime(D)));
  FileClose(F);
  DeleteFile('test.dat');
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.