Sinon, j’ai aussi découvert ceci dans la doc de 3.1:
http://docs.python.org/dev/py3k/library/mmap.html
J’ai fortement l’impression qu’il faut passer par des instances issues de cette classe mmap pour faire des transferts de bytes avec un fichier.
Je ne connais pas du tout mais je pense que tu vas arriver à te débrouiller avec ça parce qu’il est écrit en toutes lettres:
map.write(bytes)¶
Write the bytes in bytes into memory at the current position of the file pointer; the file position is updated to point after the bytes that were written. If the mmap was created with ACCESS_READ, then writing to it will throw a TypeError exception.
mmap.write_byte(byte)¶
Write the the integer byte into memory at the current position of the file pointer; the file position is advanced by 1. If the mmap was created with ACCESS_READ, then writing to it will throw a TypeError exception.
Partager