[Github-comments] [geany/geany] Better check for a file change on disk by also monitoring the file size. (#1175)

Stefan Oberhumer notifications at xxxxx
Sat Aug 13 05:47:45 UTC 2016


> I don't see it adds much, you have to absolutely know that the newly generated file is a different length.

With the current mtime checking you have to absolutly know that the newly generated file has a greater modification time.
A file must have been changed if the file size changes!
Checking both (mtime and file size) is a better file change check for geany than just checking mtime.

> And generating files and touching their mod time

To get deterministic release tar balls, it is necessary for me to touch the files with an explicit time stamp before "tarring" them.

>is going to break much more than just Geany's detection.

That's why I added the file size check - to get a better geany.
The fstab() already includes the file size - so there should be nearly no performance costs.


> What could be sensible though is to check mtime as not equals rather than less than,
> the file is different if its moved back in time as well as forward in time.

I agree - but I didn't wanted change the existing mtime check behavior.


So the technical facts are:
  1.) If the file size changes on disk, the file has changed!
  2.) If the file size changes and the modification time is not updated geany does NOT notify the file change.
  3.) The behind laying fstat() function has the file size included - there will be nearly no performance impacts.


-- 
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/pull/1175#issuecomment-239604115
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160812/2fdd113b/attachment.html>


More information about the Github-comments mailing list