Using open/write/close/rename to avoid partial files.

Added --latest argument to generate link to latest frame.