Only set permissions when a file has changed