def copy(self):
"Copy the file to the local directory"
fpi= open(self.filename, "rb")
fpo_filename= os.path.join(
self.destination, os.path.basename(self.filename))
try:
fpo= open(fpo_filename, "r+b")
except IOError, exc:
if exc.errno == errno.ENOENT:
fpo= open(fpo_filename, "wb")
else:
raise
try:
self.phase_copy(fpi, fpo, self.phase1, self.phase2)
self.phase_copy(fpi, fpo, self.phase2, self.phase3)
finally:
self.record_state()
评论列表
文章目录