change SEND_SEGMENT message , add segmentName
change file update method, create new temp file replace original one