8

Why do text editors set the mtime on save when no changes have been made?

view full story
linux-howto

http://unix.stackexchange.com – When I am using sublime, and I've made no changes then the icon in the editor shows the file is unchanged. However, if I click to save it, it still sets the filesystem mtime time to now. Should a non-changing save really update the "modified" time? Simple example: Create an empty file $ touch example.file $ stat -l example.file -rw-r--r-- 1 matthew staff 0 Jul 9 14:45:41 2013 example.file Touching it updates the mtime $ touch example.file $ stat -l example.file -rw-r--r-- 1 matthew staff 0 Jul 9 14:45:57 2013 example.file Editing it, but making no changes, also updates the mtime (HowTos)