tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.59k stars 117 forks source link

messes up links and file permissions #5

Closed malaterre closed 11 years ago

malaterre commented 11 years ago

Apparently jpegoptim writes its output to a temporary file and uses rename(2) to move it back to the original. This breaks hard- and symlinks and changes the permissions of the file.

ref: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708630

tjko commented 11 years ago

File permissions are now preserved. And symbolic links (and other special files) are skipped to avoid "breaking" symlinks. Behavior with hard-linked files is now documented on the man page.