2012-11-12, 01:39
Hi,
EDIT: I have runned into more issues and have updated the post.
I try to use the new xbmcvfs.File api for reading and writing to files.
However I end up getting the error for buffer "TypeError: argument 1 must be string without null bytes, not str"
The problem is that the file I try to read us full of null bytes...
So what should I do?
EDIT: I have runned into more issues and have updated the post.
I try to use the new xbmcvfs.File api for reading and writing to files.
PHP Code:
fd_a = xbmcvfs.File(file_a)
buffer = fd_a.read(1024)
fd_a.close()
fd_b = xbmcvfs.File(file_b, 'w')
result = fd_b.write(buffer)
fd_b.close()
However I end up getting the error for buffer "TypeError: argument 1 must be string without null bytes, not str"
The problem is that the file I try to read us full of null bytes...
PHP Code:
for line in buffer:
print repr(line)
.....
22:25:28 T:7212 NOTICE: 'h'
22:25:28 T:7212 NOTICE: '\xf8'
22:25:28 T:7212 NOTICE: '\x00'
22:25:28 T:7212 NOTICE: '\x00'
22:25:28 T:7212 NOTICE: '\x00'
22:25:28 T:7212 NOTICE: '\x12'
22:25:28 T:7212 NOTICE: 'g'
22:25:28 T:7212 NOTICE: '\x01'
22:25:28 T:7212 NOTICE: '\x00'
22:25:28 T:7212 NOTICE: '\x00'
So what should I do?