작업은 하나의 파일 항목 내에 크기가 다른 두 개의 레코드를 만듭니다. 내가 테스트를 위해 파이썬 3.4.5을 사용하고 있습니다 :레코드 리눅스의 자기 테이프 끝 부분에 쓰기
import fcntl
import os
import struct
MTIOCTOP = 0x40086d01 # refer to mtio.h
MTSETBLK = 20
fh = os.open('/dev/st2', os.O_WRONLY)
fcntl.ioctl(fh, MTIOCTOP, struct.pack('hi', MTSETBLK, 1024))
os.write(fh, b'a'*1024)
fcntl.ioctl(fh, MTIOCTOP, struct.pack('hi', MTSETBLK, 2048))
os.write(fh, b'b'*2048)
os.close(fh)
[[email protected] mhvtl]# tcopy /dev/st2
file 0: block size 4096: 1 records
file 0: eof after 1 records: 4096 bytes <<< should be 2 records
eot
total length: 4096 bytes
[[email protected] mhvtl]# ^C
가변 레코드 길이 테이프에 새로운 기록을 시작할 것 IOCTL 옵트 코드가있다. 또는 다른 방법으로이 버그를 해결할 수 있습니까?