The Mmap class implement memory-mapped file objects
WARNING The variables $' and $` are not available with gsub! and sub!
Comparable
Enumerable
disable paging of all pages mapped. flag can be
Mmap::MCL_CURRENT or Mmap::MCL_FUTURE
create a new Mmap object
- file
Pathname of the file, if <em>nil</em> is given an anonymous map
is created <em>Mmanp::MAP_ANON</em>
- mode
Mode to open the file, it can be "r", "w", "rw", "a"
- protection
specify the nature of the mapping
- Mmap::MAP_SHARED
Creates a mapping that's shared with all other processes
mapping the same areas of the file.
The default value is <em>Mmap::MAP_SHARED</em>
- Mmap::MAP_PRIVATE
Creates a private copy-on-write mapping, so changes to the
contents of the mmap object will be private to this process
- options
Hash. If one of the options <em>length</em> or <em>offset</em>
is specified it will not possible to modify the size of
the mapped file.
- length
Maps <em>length</em> bytes from the file
- offset
The mapping begin at <em>offset</em>
- advice
The type of the access (see #madvise)
add count bytes to the file (i.e. pre-extend the file)
advice can have the value Mmap::MADV_NORMAL,
Mmap::MADV_RANDOM, Mmap::MADV_SEQUENTIAL,
Mmap::MADV_WILLNEED, Mmap::MADV_DONTNEED
change the mode, value must be "r", "w" or
"rw"
terminate the association
Other methods with the same syntax than for the class String
return an index of the match
retrieve the nth character
return a substring from start to last
return a substring of lenght characters from start
change the nth character with val
change substring from start to last with val
replace length characters from start with val.
comparison : return -1, 0, 1
append the contents of other
change the first character to uppercase letter
chop off the last character
chop off the line ending character, specified by rs
each parameter defines a set of character to count
delete every characters included in str
change all uppercase character to lowercase character
return true if the file is empty
return true if the file is frozen
return true if other is found
return the index of substr
return the size of the file
reverse the content of the file
return the index of the last occurrence of substr
return an array of all occurence matched by pattern
iterate through the file, matching the pattern
return the size of the file
delete the specified portion of the file
splits into a list of strings and return this array
squeezes sequences of the same characters which is included in str
removes leading and trailing whitespace
replaces all lowercase characters to uppercase characters, and vice-versa
translate the character from search to replace
translate the character from search to replace, then
squeeze sequence of the same characters