Class | Mmap |
In: |
doc/mmap.rb
|
Parent: | Object |
disable paging of all pages mapped. flag can be Mmap::MCL_CURRENT or Mmap::MCL_FUTURE
# File doc/mmap.rb, line 15 15: def lockall(flag) 16: end
Pathname of the file, if nil is given an anonymous map is created Mmanp::MAP_ANON
Mode to open the file, it can be "r", "w", "rw", "a"
specify the nature of the mapping
Creates a mapping that‘s shared with all other processes mapping the same areas of the file. The default value is Mmap::MAP_SHARED
Creates a private copy-on-write mapping, so changes to the contents of the mmap object will be private to this process
Hash. If one of the options length or offset is specified it will not possible to modify the size of the mapped file.
length: | maps length bytes from the file |
offset: | the mapping begin at offset |
advice: | the type of the access (see madvise) |
# File doc/mmap.rb, line 57 57: def new(file, mode = "r", protection = Mmap::MAP_SHARED, options = {}) 58: end
change the first character to uppercase letter
# File doc/mmap.rb, line 200 200: def capitalize! 201: end
chop off the line ending character, specified by rs
# File doc/mmap.rb, line 210 210: def chomp!(rs = $/) 211: end
change all uppercase character to lowercase character
# File doc/mmap.rb, line 230 230: def downcase! 231: end
advice can have the value Mmap::MADV_NORMAL, Mmap::MADV_RANDOM, Mmap::MADV_SEQUENTIAL, Mmap::MADV_WILLNEED, Mmap::MADV_DONTNEED
# File doc/mmap.rb, line 75 75: def madvise(advice) 76: end
change the mode, value must be "r", "w" or "rw"
# File doc/mmap.rb, line 80 80: def mprotect(mode) 81: end
return an array of all occurence matched by pattern
# File doc/mmap.rb, line 310 310: def scan(pattern) 311: end
iterate through the file, matching the pattern
# File doc/mmap.rb, line 315 315: def scan(pattern) 316: yield str 317: end
splits into a list of strings and return this array
# File doc/mmap.rb, line 336 336: def split([sep[, limit]]) 337: end
squeezes sequences of the same characters which is included in str
# File doc/mmap.rb, line 341 341: def squeeze!([str]) 342: end
replaces all lowercase characters to uppercase characters, and vice-versa
# File doc/mmap.rb, line 376 376: def swapcase! 377: end
translate the character from search to replace
# File doc/mmap.rb, line 381 381: def tr!(search, replace) 382: end