equal
deleted
inserted
replaced
770 |
770 |
771 All writes will be redirected to a temporary copy of the original |
771 All writes will be redirected to a temporary copy of the original |
772 file. When rename is called, the copy is renamed to the original |
772 file. When rename is called, the copy is renamed to the original |
773 name, making the changes visible. |
773 name, making the changes visible. |
774 """ |
774 """ |
775 def __init__(self, name, mode, createmode): |
775 def __init__(self, name, mode='w+b', createmode=None): |
776 self.__name = name |
776 self.__name = name |
777 self._fp = None |
777 self._fp = None |
778 self.temp = mktempcopy(name, emptyok=('w' in mode), |
778 self.temp = mktempcopy(name, emptyok=('w' in mode), |
779 createmode=createmode) |
779 createmode=createmode) |
780 self._fp = posixfile(self.temp, mode) |
780 self._fp = posixfile(self.temp, mode) |