1.1 --- a/lib/posix/io.py Tue Dec 06 20:32:33 2016 +0100
1.2 +++ b/lib/posix/io.py Tue Dec 06 20:35:50 2016 +0100
1.3 @@ -21,6 +21,28 @@
1.4
1.5 import native
1.6
1.7 +class sysfile:
1.8 +
1.9 + "A system-level file object."
1.10 +
1.11 + def __init__(self, fd):
1.12 +
1.13 + "Initialise the file with the given 'fd'."
1.14 +
1.15 + self.fd = fd
1.16 +
1.17 + def read(self, n):
1.18 +
1.19 + "Read 'n' bytes from the file."
1.20 +
1.21 + return read(self.fd, n)
1.22 +
1.23 + def write(self, s):
1.24 +
1.25 + "Write 's' to the file."
1.26 +
1.27 + write(self.fd, str(s))
1.28 +
1.29 def close(fd): pass
1.30 def closerange(fd_low, fd_high): pass
1.31 def dup(fd): pass