when create a file, truncate its length