+ Added missing FileSetDate call

git-svn-id: trunk@403 -
This commit is contained in:
michael 2005-06-14 11:46:31 +00:00
parent a3ff4850f7
commit d2d33c03fb
3 changed files with 36 additions and 0 deletions

View File

@ -83,6 +83,7 @@ Function FindNext (Var Rslt : TSearchRec) : Longint;
Procedure FindClose (Var F : TSearchrec);
Function FileGetDate (Handle : Longint) : Longint;
Function FileSetDate (Handle,Age : Longint) : Longint;
Function FileSetDate (Const FileName : String;Age : Longint) : Longint;
Function FileGetAttr (Const FileName : String) : Longint;
Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
Function DeleteFile (Const FileName : String) : Boolean;

View File

@ -54,6 +54,25 @@
{$endif OS_FILEISREADONLY}
{$ifndef OS_FILESETDATEBYNAME}
Function FileSetDate (Const FileName : String;Age : Longint) : Longint;
Var
fd : longint;
begin
fd:=FileOpen(FileName,fmOpenRead);
If (Fd>=0) then
try
Result:=FileSetDate(fd,Age);
finally
FileClose(fd);
end
else
Result:=Fd;
end;
{$endif}
{ Read String Handling functions implementation }
{$i sysstr.inc}

View File

@ -20,6 +20,7 @@ interface
{ force ansistrings }
{$H+}
{$DEFINE OS_FILESETDATEBYNAME}
{$DEFINE HAS_SLEEP}
{$DEFINE HAS_OSERROR}
{$DEFINE HAS_OSCONFIG}
@ -646,6 +647,19 @@ begin
Result := fpAccess(PChar(FileName),W_OK)<>0;
end;
Function FileSetDate (Const FileName : String;Age : Longint) : Longint;
var
t: TUTimBuf;
begin
Result := 0;
t.actime := Age;
t.modtime := Age;
if fputime(PChar(FileName), @t) = -1 then
Result := fpgeterrno;
end;
{****************************************************************************
Disk Functions
****************************************************************************}
@ -1023,6 +1037,8 @@ begin
Result:=fpgetErrNo;
end;
{ ---------------------------------------------------------------------
Application config files
---------------------------------------------------------------------}