how to partition file on opening