use off_t instead unsigned long
rename file but not overwrite
fix off_t type bug