MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / skip

Method skip

tools/python-3.11.9-amd64/Lib/chunk.py:149–173  ·  view source on GitHub ↗

Skip the rest of the chunk. If you are not interested in the contents of the chunk, this method should be called so that the file points to the start of the next chunk.

(self)

Source from the content-addressed store, hash-verified

147 return data
148
149 def skip(self):
150 """Skip the rest of the chunk.
151 If you are not interested in the contents of the chunk,
152 this method should be called so that the file points to
153 the start of the next chunk.
154 """
155
156 if self.closed:
157 raise ValueError("I/O operation on closed file")
158 if self.seekable:
159 try:
160 n = self.chunksize - self.size_read
161 # maybe fix alignment
162 if self.align and (self.chunksize & 1):
163 n = n + 1
164 self.file.seek(n, 1)
165 self.size_read = self.size_read + n
166 return
167 except OSError:
168 pass
169 while self.size_read < self.chunksize:
170 n = min(8192, self.chunksize - self.size_read)
171 dummy = self.read(n)
172 if not dummy:
173 raise EOFError

Callers 2

initfpMethod · 0.95
closeMethod · 0.95

Calls 3

readMethod · 0.95
minFunction · 0.85
seekMethod · 0.45

Tested by

no test coverage detected