Thomas Hood wrote:
> P.S.
> 
> The patched script updates the mtime by doing:
> 
>     echo "" >> "$TMP_FILE"
> 
> This is less than idea, since it adds a useless CR
> to the end of the file.  I tried:
> 
>     : >> "$TMP_FILE"
> 
> which doesn't add anything to the file, but this failed
> to change the mtime.
> 
> Perhaps you can think of something better.

cp file file.new
mv file.new file

has the desired effect and atomically changes the mtime without a race
window where the contents of file may be invalid.

Simon.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to