Port:Add safe replace existing file is larger but new file is proper.
Merge pull request #613 from JackDandy/port_add_safe_replace_smaller_but_proper

Port:Add safe replace existing file is larger but new file is proper.