[Github-comments] [geany/geany] in some cases, Geany doesn't detect file has been overwritten (#2133)

elextr notifications at xxxxx
Mon Apr 29 07:52:05 UTC 2019


> Naw, it's technically the "right thing". mtime is only updated when the contents are changed. When you copy and overwrite/paste a file in a file manager, you're essentially deleting the destination file, and putting the copied file in its place.

Yeah, the file mangler is __replacing__ the file, in fact mine even says "do you want to replace" in its dialog :)

Geany is checking for a file having its contents changed, not the file itself being replaced.

> What Geany should probably do is use the ctime, which covers both the contents and metadata.

But st_ctime doesn't cover a file having its contents changed "The field st_ctime is changed by writing or by setting inode information (i.e., owner, group, link count, mode, etc.)" (from `man 7 inode`).

And on Windows [IIGC](https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019) st_ctime is creation time not metadata time. 

I am not sure why Geany doesn't test equals which would handle both.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2133#issuecomment-487482070
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190429/2d79d0fe/attachment.html>


More information about the Github-comments mailing list