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

Method read

recipes/Python/173071_ReseekFile/recipe-173071.py:67–76  ·  view source on GitHub ↗

read up to 'size' bytes from the file Default is -1, which means to read to end of file.

(self, size = -1)

Source from the content-addressed store, hash-verified

65 return x
66
67 def read(self, size = -1):
68 """read up to 'size' bytes from the file
69
70 Default is -1, which means to read to end of file.
71 """
72 x = self._read(size)
73 if self.at_beginning and x:
74 self.at_beginning = 0
75 self._check_no_buffer()
76 return x
77
78 def readline(self):
79 """read a line from the file"""

Callers 15

readlinesMethod · 0.95
myPrintLongFunction · 0.45
myPrintStringFunction · 0.45
__call__Method · 0.45
extractFunction · 0.45
recipe-104733.pyFile · 0.45
recipe-115419.pyFile · 0.45
loadFunction · 0.45
__init__Method · 0.45
_getMethod · 0.45
mainFunction · 0.45
process_mailboxFunction · 0.45

Calls 2

_readMethod · 0.95
_check_no_bufferMethod · 0.95

Tested by

no test coverage detected