You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value of st_ctime from stat() does not actually refer to the file creation time. It may be accurate when a file is first created, but this value may be updated after the file is modified in certain ways (apparently, including the file size changing, which is very common).
On Linux, the value of stx_btime.tv_sec from a separate statx() call may be used to get the actual file creation time.
On macOS, the value of st_birthtime from the existing stat() call may be used to get the actual file creation time.
I created a pull request for hxcpp with the necessary change, but I wasn't able to successfully build HashLink on macOS, so I'm simply reporting the issue instead.
Code to reproduce:
The creation time should not change, but it does.
The relevant code:
hashlink/src/std/sys.c
Line 389 in 31de39d
The value of
st_ctime
fromstat()
does not actually refer to the file creation time. It may be accurate when a file is first created, but this value may be updated after the file is modified in certain ways (apparently, including the file size changing, which is very common).On Linux, the value of
stx_btime.tv_sec
from a separatestatx()
call may be used to get the actual file creation time.On macOS, the value of
st_birthtime
from the existingstat()
call may be used to get the actual file creation time.I created a pull request for hxcpp with the necessary change, but I wasn't able to successfully build HashLink on macOS, so I'm simply reporting the issue instead.
Related hxpp pull: HaxeFoundation/hxcpp#1063
The text was updated successfully, but these errors were encountered: