Recent

Author Topic: TsearchRec.time is 32 bit signed on Linux  (Read 853 times)

Borneq

  • Full Member
  • ***
  • Posts: 238
TsearchRec.time is 32 bit signed on Linux
« on: January 20, 2020, 07:30:38 pm »
I see, that field time in Linux is only one and is only longint.
This means that resolution is to seconds., it is Unix epoch time and ends on 2034 tyear?

PascalDragon

  • Hero Member
  • *****
  • Posts: 2264
  • Compiler Developer
Re: TsearchRec.time is 32 bit signed on Linux
« Reply #1 on: January 20, 2020, 10:02:34 pm »
This is correct (though it won't end on 2034, it will overflow, thus resulting in a negative timestamp). You can use FileDateToDateTime to convert the Time field to a TDateTime (though with the same resolution restriction) or you can use the Timestamp property that's going to be introduced with 3.2 and which can - if available - use a higher resolution timestamp. E.g. on Windows it will use the modification time of type FILETIME in FindData while on *nix it currently uses the 32-bit timestamp, though that can be changed in the future.

Borneq

  • Full Member
  • ***
  • Posts: 238
Re: TsearchRec.time is 32 bit signed on Linux
« Reply #2 on: January 25, 2020, 12:17:30 pm »
I must remember: FindFirst/FindNext get time in local, not Universal time.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8797
  • FPC developer.
Re: TsearchRec.time is 32 bit signed on Linux
« Reply #3 on: January 25, 2020, 03:47:30 pm »
It has been updated to 64-bit now in trunk.

 

TinyPortal © 2005-2018