2016-12-06 | Paul Boddie | file changeset files shortlog | Fixed the native read function, allocating new strings from the input buffer. Added a value to IOError instances and fixed IOError raising in the native functions and helper functions. Added a test of reading data and updated the test runner to send some default input into every test. |
paul@331 | 1 | from posix.io import read |
paul@331 | 2 | |
paul@331 | 3 | try: |
paul@331 | 4 | s = read(3, 10) |
paul@331 | 5 | except IOError, exc: |
paul@331 | 6 | print "read(3, 10): input/output error condition", exc.value |
paul@331 | 7 | |
paul@331 | 8 | s = read(0, 10) |
paul@331 | 9 | print s |