neutralinojs / neutralinojs

Portable and lightweight cross-platform desktop application development framework
https://neutralino.js.org
Other
7.48k stars 377 forks source link

MacOS - getStats create timestamp broken #907

Open Blatman opened 2 years ago

Blatman commented 2 years ago

Created a text file on desktop and create/modify times OK. (both were 1653727681000) Modified text file - create time changed, modify time remained at create time. Modified text file again - both create/modify times changed to same value Modified text file yet again - both create/modify times changed to same value

1st modify result

First modify

2nd modify result

Second modify

3rd modify result

Third modify

Raw API object after 3rd modify -

raw api
Blatman commented 2 years ago

Just been looking further and if the text file is opened and read then closed with no modification of content or permissions then the createdAt will change. This suggests that the createdAt parameter is fed by the atime of the stat command rather than the ctime (the ModifiedAt is no doubt using the mtime). I tried this test with a number of different applications and all changed the createdAt stamp however it is notable that if Get Info in Preview is used to check the text file stamps the create date remains as original. Without any changes to the file itself(permissions, etc) I would expect with any content changes that the atime and mtime would update but the ctime should remain original therefore createdAt should also.