Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save modification time with sub-second granularity #252

Merged
merged 1 commit into from
May 9, 2014

Conversation

blaenk
Copy link
Contributor

@blaenk blaenk commented May 9, 2014

Some systems can get the file modification time with sub-second
granularity. However, Hakyll shaves off the sub-seconds, as defined in
the Binary instance of BinaryTime, which poses a problem because when a
file is checked to see if it was modified in resourceModified, it
still contains the sub-seconds. This results in a file (almost) always
being considered as having been modified.

Example:

  1. First go around, modification time is 3:45.325. This time is saved
    as 3:45.000 (i.e. sub-seconds are shaved off).
  2. Second go around, modification time is again read as 3:45.325 and
    compared against the stored time, 3:45.000. 3:45.325 is more recent
    than 3:45.000, so the file is considered to have been modified.

This change prevents the shaving off of sub-seconds. This will naturally
work on systems that don't support sub-second granularity, as that
'field' will simply appear as all zeros.

Note that this is an improvement of PR #251 which shaved off the sub-seconds. This one keeps them.

Closes #250

Some systems can get the file modification time with sub-second
granularity. However, Hakyll shaves off the sub-seconds, as defined in
the Binary instance of BinaryTime, which poses a problem because when a
file is checked to see if it was modified in `resourceModified`, it
still contains the sub-seconds. This results in a file (almost) always
being considered as having been modified.

Example:

1. First go around, modification time is 3:45.325. This time is saved
   as 3:45.000 (i.e. sub-seconds are shaved off).
2. Second go around, modification time is again read as 3:45.325 and
   compared against the stored time, 3:45.000. 3:45.325 is more recent
   than 3:45.000, so the file is considered to have been modified.

This change prevents the shaving off of sub-seconds. This will naturally
work on systems that don't support sub-second granularity, as that
'field' will simply appear as all zeros.

Closes jaspervdj#250
@jaspervdj
Copy link
Owner

Thanks a lot! I'll put it on Hackage.

jaspervdj added a commit that referenced this pull request May 9, 2014
save modification time with sub-second granularity
@jaspervdj jaspervdj merged commit 12dc25d into jaspervdj:master May 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

./hakyll build always rebuilds everything after switching to GHC 7.8 and Hakyll 4.5.1.0
2 participants