You probably don't want to use > as a mode. You can map a :utf8 filehandle, but writing to it may be tricky. See PerlIO for more information on how that works. Most importantly this means that on Windows you have to remember to use the :raw open mode or binmode to make your filehandles binary before mapping them, as by default it would do crlf transformation. This module doesn't do any encoding or newline transformation for you, and will reject any filehandle with such features enabled as mapping it would return a different value than reading it normally. If the length of the file is an exact multiple of the page size, some regexps can trigger a segmentation fault. In perl versions before 5.17.5, there is an off-by-one bug in Perl's regexp engine, as explained here. If you are working with such large files, it is strongly recommended to upgrade to 5.12. Effectively this means you can't use them on strings bigger than 2GB. In perl versions before 5.11.5 many string functions including substr are limited to 32bit logic, even on 64bit architectures. Perl 5.8.8 or higher is recommended because older versions can give spurious warnings. This module depends on perl 5.8 and Sub::Exporter::Progressive. This warning is only given when use warnings 'substr' is in effect. Overwriting an empty map is rather nonsensical, hence a warning is given when this is tried. This warning is only given when use warnings 'io' is in effect. This obviously is of little use when you can't change the map. Sync flushes changes to the map to the filesystem. This warning is only given when use warnings 'portable' is in effect. This is either a typo or a portability issue. You gave advise an advice it didn't know. Note that this may become an exception in a future version. This warning is only given when use warnings 'layer' is in effect. Encoding layers are not supported by File::Map. You tried to to map a filehandle that has some encoding layer. This warning is additional to the previous one, warning you that you're losing data. Truncating new value to size of the memory map As a compromise, File::Map is capable of fixing up the mess if you do it nonetheless, but it will warn you that you're doing something you shouldn't. Writing directly to a memory mapped file is not recommendedĭue to the way perl works internally, it's not possible to write a mapping implementation that allows direct assignment yet performs well. The flag given for map_anonymous isn't valid, it should either be shared or private. This may mean it's a scalar string handle or a tied handle. The offset and/or length you specified were invalid for this file. Zero length not allowed for anonymous mapĪ zero length anonymous map is not possible (or in any way useful).Īn attempt was made to remap a mapping that is shared among different threads, this is not possible. You tried to wait_until, notify or broadcast on an unlocked variable. Your OS didn't allow File::Map to do what you asked it to do for some reason. * map_file $lvalue, $filename, $mode = ': this variable is not memory mappedĪn attempt was made to sync, remap, unmap, pin, unpin, advise or lock_map an unmapped variable. $offset and $length are byte positions in the file, and default to mapping the whole file. Advantages of this module over other similar modules.
0 Comments
Leave a Reply. |