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

Use sha has instead of file size to check for changes #1

Open
chriswheeler opened this issue Jan 10, 2018 · 0 comments
Open

Use sha has instead of file size to check for changes #1

chriswheeler opened this issue Jan 10, 2018 · 0 comments

Comments

@chriswheeler
Copy link

If i'm reading the code correctly, you are currently using the size of the file to check if it has changed.

However, some changes such as a single character will result in the file being the same size, but changed. I'd therefore suggest using sha($file) instead of size($file) to check if it's content has changed.

Also, you probably don't need to write the size/sha has to disk, just store it in a variable and of course don't reboot on the first check.

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

No branches or pull requests

1 participant