summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/multifil.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-26 22:14:20 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-26 22:14:20 (GMT)
commit548703a1b81f6adf68a3dd4b497a88f5c4a31f4a (patch)
tree8fc46e5faa2a7e82e6748995c555d7fe0b781449 /Lib/dos-8x3/multifil.py
parent65e5399081e23d7b1efbf685096c65d0a0ab912b (diff)
downloadcpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.zip
cpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.tar.gz
cpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.tar.bz2
The usual.
Diffstat (limited to 'Lib/dos-8x3/multifil.py')
-rwxr-xr-xLib/dos-8x3/multifil.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/dos-8x3/multifil.py b/Lib/dos-8x3/multifil.py
index 71e0dd0..8ba88e4 100755
--- a/Lib/dos-8x3/multifil.py
+++ b/Lib/dos-8x3/multifil.py
@@ -44,8 +44,17 @@ class MultiFile:
return self.lastpos
return self.fp.tell() - self.start
#
- def seek(self, pos):
- if not 0 <= pos <= self.tell() or \
+ def seek(self, pos, whence=0):
+ here = self.tell()
+ if whence:
+ if whence == 1:
+ pos = pos + here
+ elif whence == 2:
+ if self.level > 0:
+ pos = pos + self.lastpos
+ else:
+ raise Error, "can't use whence=2 yet"
+ if not 0 <= pos <= here or \
self.level > 0 and pos > self.lastpos:
raise Error, 'bad MultiFile.seek() call'
self.fp.seek(pos + self.start)