Commit Graph

210 Commits

Author SHA1 Message Date
Michaël Van Canneyt
545db4a070 * Extend GetLocalTimeOffset to return Dst or not 2025-02-19 17:31:01 +01:00
Michaël Van Canneyt
c3339e9a51 * Prevent file handle leak 2024-01-28 11:30:37 +01:00
Michaël Van Canneyt
e79f5ef577 * Introduce fmShareNoLocking to disable locking of file descriptors on unix 2024-01-28 11:30:37 +01:00
florian
4dc4d2b2ba * use TTimespecArr instead of tkernel_timespecs in sysutils 2024-01-17 23:25:03 +01:00
florian
774e0f9122 + support for fputimens on non-linux OSes
* reworked fputimens support on linux
  + FileSetDate for all unix OSes
2024-01-14 22:23:11 +01:00
florian
3cd2cbcda8 * GetEpochTime (not used though it seems) should return time_t 2023-12-03 23:28:23 +01:00
Pierre Muller
603614e28e Adapt USE_STATX code to FPC_DOTTEDUNITS 2023-08-02 14:18:26 +02:00
Michael VAN CANNEYT
ccfa38c68e * Dotted RTL compiles 2023-07-27 19:04:03 +02:00
Michael VAN CANNEYT
78374bf772 * Synchronize API for AnsiString/Unicode string, keep string where possible. 2023-07-24 15:38:09 +02:00
Pierre Muller
512faa7141 Restore usage of fpexecve function inside ExecuteProcess
as set by commit 305d34a8f6
2023-07-19 18:03:02 +02:00
Michael VAN CANNEYT
b9a1a90d6e * String -> ansistring 2023-07-14 17:26:11 +02:00
Michael VAN CANNEYT
6ffa3d4a89 * Char -> AnsiChar 2023-07-14 17:26:09 +02:00
Pierre Muller
be1cc68a99 Change libc statx function to weakexternal
Test if statx is nil before call
2023-03-12 16:28:58 +01:00
Jonas Maebe
305d34a8f6 Darwin: fix make cycle
unix.fpexecv takes a rawbytestring as first parameter, so inside the child
it was converting the pchar back to an ansistring and also converting it
to the OS file system code page. Since Darwin uses vfork/execv in
SysUtils.Executeprocess, this could result in (exception)stack corruption
and for some reason only since d1b2fe16 it actually caused issues.

Use execve instead, which takes a pchar as first argument and doesn't
do any further conversions
2023-01-22 22:34:25 +01:00
Michaël Van Canneyt
770c21c0dd * Fix compile error for i386-linux 2023-01-21 20:21:29 +01:00
Michael Van Canneyt
d1b2fe1659 * Date/Time info for files (Delphi compatibility) 2023-01-21 13:45:04 +01:00
Michaël Van Canneyt
e97e27b8d5 * Raise exception for fileseek positions that do not fit in longing. Issue #39407 2021-10-17 17:58:11 +02:00
Nikolay Nikolov
f21273612a + also fill DayOfWeek in the Unix implementation of SysUtils.GetLocalTime 2021-10-13 02:39:04 +03:00
florian
c1f85ac3a1 + initial implementation of path dependent IsFileNameCaseSensitive/IsFileNameCasePreserving functions for darwin
git-svn-id: trunk@49164 -
2021-04-10 13:29:59 +00:00
florian
3e453f92fc * statx based Sysutils.FileGetDate with handle fixed
+ test

git-svn-id: trunk@48520 -
2021-02-07 17:59:28 +00:00
florian
b08717fef6 * make statx based Sysutils.FileAge working with relative pathes
+ test

git-svn-id: trunk@48519 -
2021-02-07 17:41:27 +00:00
florian
b4a1c27c58 * renamed new syscall wrapper in linux to be consist with the others
git-svn-id: trunk@48479 -
2021-01-31 22:25:18 +00:00
florian
90ba89a128 * linux: FileGetDate makes use of statx if needed
git-svn-id: trunk@48476 -
2021-01-31 18:38:50 +00:00
florian
ef04e3983f * sysutils on linux uses only the new syscalls if the system has no suitable clong type
git-svn-id: trunk@48475 -
2021-01-31 18:20:01 +00:00
florian
c3656c6b1c * fallback to fputime if fputimensat fails as not being available
git-svn-id: trunk@48474 -
2021-01-31 18:09:57 +00:00
florian
d402e0b940 * Y2K38 problem for linux in sysutils.findfirst/findnext should be solved
git-svn-id: trunk@48473 -
2021-01-31 18:02:55 +00:00
florian
b8ab06aae7 + futimens syscall
* make use of futimens syscall in sysutils unit
  + tests

git-svn-id: trunk@48472 -
2021-01-31 17:12:39 +00:00
florian
e6f575d43c + make use of the fputimensat syscall on linux to enable always times beyond 32 bit
git-svn-id: trunk@48471 -
2021-01-31 16:43:53 +00:00
florian
f39f8d0f1a * linux: make use of statx in Sysutils.FileAge if available
git-svn-id: trunk@48457 -
2021-01-30 18:47:27 +00:00
ondrej
63beb1e83a * revert r47532, r47527 (use timezone information from fpgettimeofday) because they are not available on all Linux distributions
git-svn-id: trunk@47541 -
2020-11-23 15:17:52 +00:00
ondrej
28d88b9999 * GetLocalTimeOffset: use timezone information from fpgettimeofday
git-svn-id: trunk@47532 -
2020-11-22 19:50:40 +00:00
ondrej
f5a95782a9 * use timezone information from fpgettimeofday for getting local datetime
git-svn-id: trunk@47527 -
2020-11-22 15:39:37 +00:00
michael
664283af9e * Optimized DiskAdd/DiskFree/AddDisk, bug ID #37523
git-svn-id: trunk@47365 -
2020-11-09 19:34:06 +00:00
ondrej
3ee2097f1a * unix timezone optimizations
git-svn-id: trunk@47321 -
2020-11-05 12:45:35 +00:00
ondrej
7fbceaac21 * thread-safe time zone info read/write
git-svn-id: trunk@47309 -
2020-11-04 14:56:56 +00:00
ondrej
934f2dc55d * introduce NowUTC() and GetUniversalTime()
git-svn-id: trunk@47306 -
2020-11-04 09:34:08 +00:00
ondrej
a02d676b06 GetLocalTimeOffset: add InputIsUTC parameter to DateTime-aware overloads
git-svn-id: trunk@47293 -
2020-11-03 18:15:16 +00:00
ondrej
f4cff81881 LocalToEpoch, EpochToLocal: fix for arbitrary datetime
git-svn-id: trunk@47291 -
2020-11-03 14:27:07 +00:00
ondrej
282aa0daa7 GetLocalTimeOffset: DateTime-aware overloads for Unix. Issue #35710
git-svn-id: trunk@47290 -
2020-11-03 11:41:28 +00:00
ondrej
0d08b98d47 GetLocalTimeOffset: DateTime-aware overloads (Windows supported, Unix is a ToDo). Issue #35710
git-svn-id: trunk@47206 -
2020-10-26 12:29:18 +00:00
joost
e7f5b89c2c * Avoid doing a syscall with a nil parameter in fileexists
git-svn-id: trunk@44090 -
2020-02-02 11:06:14 +00:00
florian
01302bc47d * subroutines working with an OS dependend time stamp use an int64 now, so the 2038 problem
on unixes can be tackled

git-svn-id: trunk@44010 -
2020-01-21 20:59:20 +00:00
svenbarth
f46b8539d0 * implement FileSymLinkGetTarget for *nix systems
git-svn-id: trunk@43113 -
2019-10-03 12:07:33 +00:00
svenbarth
2a38d07d8f * implement FollowLink=False handling for DirectoryExists and FileExists on *nix systems
git-svn-id: trunk@43112 -
2019-10-03 12:07:28 +00:00
svenbarth
46dac1419e * fix FileExists on *nix systems returning True for directories
git-svn-id: trunk@43111 -
2019-10-03 12:07:25 +00:00
svenbarth
c26348a3dd * follow up to r42457: FreeTerminateProcs needs to be called before DoneExceptions just in case an exception is triggered due to a corrupted list
git-svn-id: trunk@42461 -
2019-07-20 08:41:59 +00:00
svenbarth
176a63b67b * fix for Mantis #35862: free the list of functions added with AddTerminateProc to avoid memory leaks
+ added test

git-svn-id: trunk@42457 -
2019-07-19 15:55:21 +00:00
yury
5e92e2d23f * Fixed crash in DiskFree() and DiskSize() on Unices due to out of bound read of the DriveStr[] array in rare cases.
git-svn-id: trunk@39866 -
2018-10-06 13:52:56 +00:00
yury
23006d16f5 * Fixed UnhookSignal when RTL_SIGDEFAULT is passed. The bug have caused crash on aarch64-android due to out of bounds read of the rtlsig2ossig[] array.
git-svn-id: trunk@39860 -
2018-10-05 18:33:55 +00:00
svenbarth
09e5f463dc + add Delphi-compatible FileGetSymLinkTarget functions to all platforms (currently returns False on all platforms); this also includes TSymLinkRec variants for both RawByteString and UnicodeString
git-svn-id: trunk@39669 -
2018-08-24 15:33:45 +00:00