diff --git a/test/write_multiple_offsets.py b/test/write_multiple_offsets.py index 4da52c8..c1887ac 100755 --- a/test/write_multiple_offsets.py +++ b/test/write_multiple_offsets.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python2 import os import sys @@ -11,7 +11,8 @@ filename = sys.argv[1] fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY) try: for i in range(2, len(sys.argv), 2): - data = bytes("a" * int(sys.argv[i+1]), 'utf-8') - os.pwrite(fd, data, int(sys.argv[i])) + data = "a" * int(sys.argv[i+1]) + os.lseek(fd, int(sys.argv[i]), os.SEEK_SET) + os.write(fd, data) finally: os.close(fd)