View Issue Details

IDProjectCategoryView StatusLast Update
0032165FPCRTLpublic2017-07-20 09:54
ReporterOndrej PokornyAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032165: [Patch] Implement TSearchRec.TimeStamp (Delphi-Compatibility)
DescriptionThe attached patch adds TSearchRec.TimeStamp: http://docwiki.embarcadero.com/Libraries/Berlin/de/System.SysUtils.TSearchRec
TagsNo tags attached.
Fixed in Revision36750
FPCOldBugId
FPCTarget
Attached Files
  • searchrec-1.patch (1,298 bytes)
    Index: rtl/objpas/sysutils/filutilh.inc
    ===================================================================
    --- rtl/objpas/sysutils/filutilh.inc	(revision 36746)
    +++ rtl/objpas/sysutils/filutilh.inc	(working copy)
    @@ -57,6 +57,10 @@
     {$ifdef USEFINDDATA}
         FindData : TFindData;
     {$endif}
    +  private
    +    function GetTimeStamp: TDateTime;
    +  public
    +    property TimeStamp: TDateTime read GetTimeStamp;
       end;
     
       TRawbyteSearchRec = Record
    @@ -72,6 +76,10 @@
     {$IFDEF USEFINDDATA}
         FindData : TFindData;
     {$ENDIF}
    +  private
    +    function GetTimeStamp: TDateTime;
    +  public
    +    property TimeStamp: TDateTime read GetTimeStamp;
       end;
     
     {$IFDEF FPC_UNICODE_RTL}
    Index: rtl/win/sysutils.pp
    ===================================================================
    --- rtl/win/sysutils.pp	(revision 36746)
    +++ rtl/win/sysutils.pp	(working copy)
    @@ -1496,7 +1496,21 @@
         result:=EExternalException;
     end;
     
    +{ TUnicodeSearchRec }
     
    +function TUnicodeSearchRec.GetTimeStamp: TDateTime;
    +begin
    +  Result := FileDateToDateTime(Time);
    +end;
    +
    +{ TRawbyteSearchRec }
    +
    +function TRawbyteSearchRec.GetTimeStamp: TDateTime;
    +begin
    +  Result := FileDateToDateTime(Time);
    +end;
    +
    +
     Initialization
       InitWin32Widestrings;
       InitExceptions;       { Initialize exceptions. OS independent }
    
    searchrec-1.patch (1,298 bytes)

Activities

Ondrej Pokorny

2017-07-19 09:37

developer  

searchrec-1.patch (1,298 bytes)
Index: rtl/objpas/sysutils/filutilh.inc
===================================================================
--- rtl/objpas/sysutils/filutilh.inc	(revision 36746)
+++ rtl/objpas/sysutils/filutilh.inc	(working copy)
@@ -57,6 +57,10 @@
 {$ifdef USEFINDDATA}
     FindData : TFindData;
 {$endif}
+  private
+    function GetTimeStamp: TDateTime;
+  public
+    property TimeStamp: TDateTime read GetTimeStamp;
   end;
 
   TRawbyteSearchRec = Record
@@ -72,6 +76,10 @@
 {$IFDEF USEFINDDATA}
     FindData : TFindData;
 {$ENDIF}
+  private
+    function GetTimeStamp: TDateTime;
+  public
+    property TimeStamp: TDateTime read GetTimeStamp;
   end;
 
 {$IFDEF FPC_UNICODE_RTL}
Index: rtl/win/sysutils.pp
===================================================================
--- rtl/win/sysutils.pp	(revision 36746)
+++ rtl/win/sysutils.pp	(working copy)
@@ -1496,7 +1496,21 @@
     result:=EExternalException;
 end;
 
+{ TUnicodeSearchRec }
 
+function TUnicodeSearchRec.GetTimeStamp: TDateTime;
+begin
+  Result := FileDateToDateTime(Time);
+end;
+
+{ TRawbyteSearchRec }
+
+function TRawbyteSearchRec.GetTimeStamp: TDateTime;
+begin
+  Result := FileDateToDateTime(Time);
+end;
+
+
 Initialization
   InitWin32Widestrings;
   InitExceptions;       { Initialize exceptions. OS independent }
searchrec-1.patch (1,298 bytes)

Michael Van Canneyt

2017-07-20 09:36

administrator   ~0101807

Patch was wrong in the sense that the implementation was only available on windows. Moved it to the correct location.

Thanks for the contribution!

Ondrej Pokorny

2017-07-20 09:54

developer   ~0101810

Correct, I missed that. Thank you!

Issue History

Date Modified Username Field Change
2017-07-19 09:37 Ondrej Pokorny New Issue
2017-07-19 09:37 Ondrej Pokorny File Added: searchrec-1.patch
2017-07-19 09:49 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-07-19 09:49 Michael Van Canneyt Status new => assigned
2017-07-20 09:36 Michael Van Canneyt Fixed in Revision => 36750
2017-07-20 09:36 Michael Van Canneyt Note Added: 0101807
2017-07-20 09:36 Michael Van Canneyt Status assigned => resolved
2017-07-20 09:36 Michael Van Canneyt Fixed in Version => 3.1.1
2017-07-20 09:36 Michael Van Canneyt Resolution open => fixed
2017-07-20 09:36 Michael Van Canneyt Target Version => 3.2.0
2017-07-20 09:54 Ondrej Pokorny Note Added: 0101810
2017-07-20 09:54 Ondrej Pokorny Status resolved => closed