0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.36.252


Current Path : /proc/self/root/home/ubuntu/s3fs-fuse/test/
Upload File :
Current File : //proc/self/root/home/ubuntu/s3fs-fuse/test/write_multiple_offsets.py

#!/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