MCPcopy Create free account
hub / github.com/ActiveState/code / close

Method close

recipes/Python/492214_dal6py/recipe-492214.py:185–200  ·  view source on GitHub ↗
(self, force)

Source from the content-addressed store, hash-verified

183
184 # Permanently Close File
185 def close(self, force):
186 assert not self.__closed
187 success = True
188 if self.__disk.exists(self.__path):
189 self.__disk.write_file(self.__path, self.__stream)
190 else:
191 if force:
192 try:
193 self.__disk.make_file(self.__path)
194 self.__disk.write_file(self.__path, self.__stream)
195 except:
196 success = False
197 else:
198 success = False
199 self.closed = self.__closed = True
200 return success
201
202 # Read From File
203 def read(self, size=None):

Callers 15

recipe-577193.jsFile · 0.45
recipe-577412.jsFile · 0.45
write_to_fileFunction · 0.45
check_all_filenamesFunction · 0.45
show_dataFunction · 0.45
show_inputFunction · 0.45
parse_feedback_dataFunction · 0.45
recipe-413701.pyFile · 0.45
handle_closeMethod · 0.45
handle_closeMethod · 0.45
connectMethod · 0.45
mainFunction · 0.45

Calls 3

existsMethod · 0.45
write_fileMethod · 0.45
make_fileMethod · 0.45

Tested by

no test coverage detected