Mmap Memory mapped File Support¶
Jenni Forlong редактировал эту страницу 1 месяц назад


Maps length bytes from the file specified by the file descriptor fileno, and returns a mmap object. If size is 0, the utmost size of the map will probably be the present dimension of the file when mmap is called. SHARED creates a mapping that’s shared with all different processes mapping the identical areas of the file. WRITE, to specify that the pages may be learn or written. It’s an error brainwave audio program to specify each flags, prot and access. See the outline of access above for info on how to use this parameter. 0. offset should be a multiple of ALLOCATIONGRANULARITY which is equal to PAGESIZE on Unix systems. If trackfd is False, the file descriptor specified by fileno won’t be duplicated, and the resulting mmap object will not be associated with the map’s underlying file. Which means the scale() and resize() methods will fail. This mode is useful to restrict the number of open file descriptors.


To ensure validity of the created memory mapping the file specified by the descriptor fileno is internally routinely synchronized with the bodily backing store on macOS. Changed in version 3.13: The trackfd parameter was added. Added in model 3.2: Context supervisor help. Closes the mmap. Subsequent calls to different strategies of the item will end in a ValueError exception being raised. This won’t shut the open file. True if the file is closed. Elective arguments start and finish are interpreted as in slice notation. Returns -1 on failure. Changed in version 3.5: Writable bytes-like object is now accepted. Flushes changes made to the in-memory copy of a file again to disk. With out use of this name there isn’t a guarantee that changes are written back earlier than the article is destroyed. If offset and dimension are specified, solely adjustments to the given vary of bytes might be flushed to disk