operating system services nary file or byte string is expected furthermorethe contents of memory-mapped file are mutable this means that modifications can be made using index-assignment and slice-assignment operators unless private mapping of the file has been madesuch changes directly alter the contents of the underlying file memory-mapping file is created by the mmap(functionwhich is slightly different on unix and windows mmap(filenolength [flags[prot [,access [offset]]]](unixreturns an mmap object that maps length bytes from the file with an integer file descriptorfileno if fileno is - anonymous memory is mapped flags specifies the nature of the mapping and is one of the followingflag meaning map_private creates private copy-on-write mapping changes to the object will be private to this process shares the mapping with all other processes mapping the same areas of the file changes to the object will affect all mappings map_shared the default flags setting is map_shared prot specifies the memory protections of the object and is the bitwise or of the followingsetting meaning prot_read prot_write prot_exec data can be read from the object modifications can be made to the object the object can contain executable instructions the default value of prot is prot_read prot_write the modes specified in prot must match the access permissions used to open the underlying file descriptor fileno in most casesthis means that the file should be opened in read/write mode (for exampleos open(nameos o_rdwr)the optional access parameter may be used as an alternative to flags and prot if givenit has one of the following valuesaccess meaning access_read access_write read-only access read/write access with write-through modifications affect the underlying file read/write access with copy-on-write modifications affect memory but do not change the underlying file access_copy when access is suppliedit is typically given as keyword argument--for examplemmap(filenolengthaccess=access_readit is an error to supply values for both access and flags the offset parameter specifies the number of bytes from the start of the file and defaults to it must be multiple of mmap allocationgranularity mmap(filenolength[tagname [,access [offset]]](windowsreturns an mmap object that maps length bytes from the file specified by the integer file descriptor fileno use fileno of - for anonymous memory if lib fl ff