Author: Ned Batchelder <[email protected]>
Branch: nedbat-sandbox
Changeset: r50002:ca8246ba93b7
Date: 2011-11-28 21:01 -0500
http://bitbucket.org/pypy/pypy/changeset/ca8246ba93b7/
Log: An implementation of do_ll_os__ll_os_fstat, no tests, not sure if
it's right.
diff --git a/pypy/translator/sandbox/sandlib.py
b/pypy/translator/sandbox/sandlib.py
--- a/pypy/translator/sandbox/sandlib.py
+++ b/pypy/translator/sandbox/sandlib.py
@@ -471,6 +471,15 @@
# don't try to read more than 256KB at once here
return f.read(min(size, 256*1024))
+ def do_ll_os__ll_os_fstat(self, fd):
+ try:
+ f = self.open_fds[fd]
+ except KeyError:
+ return super(VirtualizedSandboxedProc,
self).do_ll_os__ll_os_fstat(fd)
+ else:
+ return os.stat(f.name) # Isn't there a better way to do this?
+ do_ll_os__ll_os_fstat.resulttype = s_StatResult
+
def do_ll_os__ll_os_lseek(self, fd, pos, how):
f = self.get_file(fd)
f.seek(pos, how)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit