Class Mmap
In: mmap.rb
Parent: Object

The Mmap class implement memory-mapped file objects

WARNING The variables $' and $` are not available with gsub! and sub!

Methods
<<    capitalize!    casecmp    chomp!    chop!    concat    count    crypt    delete!    downcase!    each    each_byte    each_line    empty?    extend    flush    freeze    frozen    gsub!    gsub!    include?    index    insert    length    lockall    madvise    mlock    mprotect    msync    munlock    munmap    new    reverse!    rindex    scan    scan    self    self    self    self    self    self    self    self    self    self    self    self    self    self    self    size    slice    slice!    split    squeeze!    strip!    sub!    sub!    sum    swapcase!    tr!    tr_s!    unlockall   
Included modules
Comparable Enumerable
Public Class methods
lockall(flag)

disable paging of all pages mapped. flag can be Mmap::MCL_CURRENT or Mmap::MCL_FUTURE

new(file, mode = "r", protection = Mmap::MAP_SHARED, options = {})

create a new Mmap object

unlockall()

reenable paging

Public Instance methods
extend(count)

add count bytes to the file (i.e. pre-extend the file)

madvise(advice)

advice can have the value Mmap::MADV_NORMAL, Mmap::MADV_RANDOM, Mmap::MADV_SEQUENTIAL, Mmap::MADV_WILLNEED, Mmap::MADV_DONTNEED

mprotect(mode)

change the mode, value must be "r", "w" or "rw"

mlock()

disable paging

msync()

flush the file

flush()

same than msync

munlock()

reenable paging

munmap()

terminate the association

Other methods with the same syntax than for the class String

self(== other)
self(> other)
self(>= other)
self(< other)
self(<= other)
self(=== other)
self(<< other)
self(=~ other)
self([nth])
self([start..last])
self([start, length])
self([nth] = val)
self([start..last] = val)
self([start, len] = val)
self(<=> other)
<<(other)
casecmp(other)
concat(other)
capitalize!()
chop!()
chomp!([rs])
count(o1 [, o2, ...])
crypt(salt)
delete!(str)
downcase!()
each_byte() {|char| ...}
each([rs]) {|line| ...}
each_line([rs]) {|line| ...}
empty?()
freeze()
frozen()
gsub!(pattern, replace)
gsub!(pattern) {|str| ...}
include?(other)
index(substr[, pos])
insert(index, str)
length()
reverse!()
rindex(substr[, pos])
scan(pattern)
scan(pattern) {|str| ...}
size()
slice()
slice!()
split([sep[, limit]])
squeeze!([str])
strip!()
sub!(pattern, replace)
sub!(pattern) {|str| ...}
sum([bits])
swapcase!()
tr!(search, replace)
tr_s!(search, replace)