in azure/datalake/store/core.py [0:0]
def seek(self, loc, whence=0):
""" Set current file location
Parameters
----------
loc: int
byte location
whence: {0, 1, 2}
from start of file, current location or end of file, resp.
"""
if not self.mode == 'rb':
raise ValueError('Seek only available in read mode')
if whence == 0:
nloc = loc
elif whence == 1:
nloc = self.loc + loc
elif whence == 2:
nloc = self.size + loc
else:
raise ValueError(
"invalid whence (%s, should be 0, 1 or 2)" % whence)
if nloc < 0:
raise ValueError('Seek before start of file')
if nloc > self.size:
raise ValueError('ADLFS does not support seeking beyond file')
self.loc = nloc
return self.loc