add support to avoid creating new file if no change made

add from here: https://bugs.webkit.org/show_bug.cgi?id=113465