all bugs fixed;
 file.truncate not work, why??
 threading.Lock vs RLock