Author: Lars Wassermann <[email protected]>
Branch:
Changeset: r420:51993a43b47c
Date: 2013-05-29 09:55 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/51993a43b47c/
Log: added primitiveSetFilePosition to FilePlugin
diff --git a/spyvm/plugins/fileplugin.py b/spyvm/plugins/fileplugin.py
--- a/spyvm/plugins/fileplugin.py
+++ b/spyvm/plugins/fileplugin.py
@@ -101,6 +101,14 @@
target.setchar(start + i, contents[i])
return space.wrap_int(len_read)
[email protected]_primitive(unwrap_spec=[object, int, int])
+def primitiveFileSetPosition(interp, s_frame, w_rcvr, fd, position):
+ try:
+ os.lseek(fd, position, os.SEEK_SET)
+ except OSError:
+ raise PrimitiveFailedError
+ return w_rcvr
+
@FilePlugin.expose_primitive(unwrap_spec=[object, int])
def primitiveFileSize(interp, s_frame, w_rcvr, fd):
try:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit