mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-19 02:35:13 +00:00
19 lines
375 B
Python
19 lines
375 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
filename = sys.argv[1]
|
||
|
data = bytes('a', 'utf-8')
|
||
|
|
||
|
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
|
||
|
try:
|
||
|
os.pwrite(fd, data, 1024)
|
||
|
os.pwrite(fd, data, 16 * 1024 * 1024)
|
||
|
os.pwrite(fd, data, 18 * 1024 * 1024)
|
||
|
finally:
|
||
|
os.close(fd)
|
||
|
|
||
|
stat = os.lstat(filename)
|
||
|
assert stat.st_size == 18 * 1024 * 1024 + 1
|