Class: Mount::FS
- Inherits:
-
Object
- Object
- Mount::FS
- Defined in:
- lib/rbmount/fs.rb
Instance Method Summary collapse
- #append_attributes(optstr) ⇒ Object
- #append_options(optstr) ⇒ Object
- #attribute(key) ⇒ Object
- #attributes ⇒ Object
- #attributes=(optstr) ⇒ Object
- #bindsrc ⇒ Object
- #bindsrc=(src) ⇒ Object
- #devno ⇒ Object
- #dup ⇒ Object
- #finalize ⇒ Object
- #freq ⇒ Object
- #freq=(f) ⇒ Object
- #fs_options ⇒ Object
- #fstype ⇒ Object
- #fstype=(type) ⇒ Object
- #id ⇒ Object
-
#initialize(ptr = nil) ⇒ FS
constructor
A new instance of FS.
- #kernel? ⇒ Boolean
- #match_fstype(types) ⇒ Object
- #match_options(options) ⇒ Object
- #match_source(source = nil, cache = nil) ⇒ Object
- #match_target(source = nil, cache = nil) ⇒ Object
- #option(key) ⇒ Object
- #options ⇒ Object
- #options=(optstr) ⇒ Object
- #options_dup ⇒ Object
- #parent_id ⇒ Object
- #passno ⇒ Object
- #passno=(passn) ⇒ Object
- #prepend_attributes(optstr) ⇒ Object
- #prepend_options(optstr) ⇒ Object
- #print_debug(io) ⇒ Object
- #reset! ⇒ Object
- #root ⇒ Object
- #root=(path) ⇒ Object
- #source ⇒ Object
- #source=(src) ⇒ Object
- #srcpath ⇒ Object
- #tag ⇒ Object
- #target ⇒ Object
- #target=(targ) ⇒ Object
- #to_c ⇒ Object
- #to_mntent ⇒ Object
- #user_options ⇒ Object
- #userdata ⇒ Object
- #userdata=(data) ⇒ Object
- #vfs_options ⇒ Object
Constructor Details
Instance Method Details
#append_attributes(optstr) ⇒ Object
32 33 34 |
# File 'lib/rbmount/fs.rb', line 32 def append_attributes (optstr) Mount::C.mnt_fs_append_attributes(@pointer, optstr) end |
#append_options(optstr) ⇒ Object
36 37 38 |
# File 'lib/rbmount/fs.rb', line 36 def (optstr) Mount::C.(@pointer, optstr) end |
#attribute(key) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/rbmount/fs.rb', line 40 def attribute (key) ptr = FFI::MemoryPointer.new(:pointer).write_pointer(FFI::MemoryPointer.new(:string)) plen = FFI::MemoryPointer.new(:ulong) raise unless Mount::C.mnt_fs_get_attribute(@pointer, key, ptr, plen) ptr.read_pointer.read_string[0, plen.read_ulong] end |
#attributes ⇒ Object
48 49 50 |
# File 'lib/rbmount/fs.rb', line 48 def attributes Mount::C.mnt_fs_get_attributes(@pointer) end |
#attributes=(optstr) ⇒ Object
164 165 166 |
# File 'lib/rbmount/fs.rb', line 164 def attributes= (optstr) Mount::C.mnt_fs_set_attributes(@pointer, optstr) end |
#bindsrc ⇒ Object
52 53 54 |
# File 'lib/rbmount/fs.rb', line 52 def bindsrc Mount::C.mnt_fs_get_bindsrc(@pointer) end |
#bindsrc=(src) ⇒ Object
168 169 170 |
# File 'lib/rbmount/fs.rb', line 168 def bindsrc= (src) Mount::C.mnt_fs_set_bindsrc(@pointer, src) end |
#devno ⇒ Object
56 57 58 |
# File 'lib/rbmount/fs.rb', line 56 def devno Mount::C.mnt_fs_get_devno(@pointer) end |
#dup ⇒ Object
224 225 226 227 228 |
# File 'lib/rbmount/fs.rb', line 224 def dup Mount::FS.new.tap {|d| Mount::C.mnt_copy_fs(d.to_c, self.to_c) } end |
#finalize ⇒ Object
220 221 222 |
# File 'lib/rbmount/fs.rb', line 220 def finalize Mount::C.mnt_free_fs(@pointer) end |
#freq ⇒ Object
60 61 62 |
# File 'lib/rbmount/fs.rb', line 60 def freq Mount::C.mnt_fs_get_freq(@pointer) end |
#freq=(f) ⇒ Object
172 173 174 |
# File 'lib/rbmount/fs.rb', line 172 def freq= (f) Mount::C.mnt_fs_set_freq(@pointer, f) end |
#fstype ⇒ Object
68 69 70 |
# File 'lib/rbmount/fs.rb', line 68 def fstype Mount::C.mnt_fs_get_fstype(@pointer) end |
#fstype=(type) ⇒ Object
176 177 178 |
# File 'lib/rbmount/fs.rb', line 176 def fstype= (type) Mount::C.mnt_fs_set_fstype(@pointer, type) end |
#id ⇒ Object
72 73 74 |
# File 'lib/rbmount/fs.rb', line 72 def id Mount::C.mnt_fs_get_id(@pointer) end |
#kernel? ⇒ Boolean
132 133 134 |
# File 'lib/rbmount/fs.rb', line 132 def kernel? Mount::C.mnt_fs_is_kernel(@pointer) end |
#match_fstype(types) ⇒ Object
136 137 138 |
# File 'lib/rbmount/fs.rb', line 136 def match_fstype (types) Mount::C.mnt_fs_match_fstype(@pointer, types) end |
#match_options(options) ⇒ Object
140 141 142 |
# File 'lib/rbmount/fs.rb', line 140 def () Mount::C.(@pointer, ) end |
#match_source(source = nil, cache = nil) ⇒ Object
144 145 146 |
# File 'lib/rbmount/fs.rb', line 144 def match_source (source=nil, cache=nil) Mount::C.mnt_fs_match_source(@pointer, source, (cache ? cache.to_c : cache)) end |
#match_target(source = nil, cache = nil) ⇒ Object
148 149 150 |
# File 'lib/rbmount/fs.rb', line 148 def match_target (source=nil, cache=nil) Mount::C.mnt_fs_match_target(@pointer, source, (cache ? cache.to_c : cache)) end |
#option(key) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/rbmount/fs.rb', line 76 def option (key) ptr = FFI::MemoryPointer.new(:pointer).write_pointer(FFI::MemoryPointer.new(:string)) plen = FFI::MemoryPointer.new(:ulong) raise unless Mount::C.mnt_fs_get_option(@pointer, key, ptr, plen) ptr.read_pointer.read_string[0, plen.read_ulong] end |
#options=(optstr) ⇒ Object
180 181 182 |
# File 'lib/rbmount/fs.rb', line 180 def (optstr) Mount::C.(@pointer, optstr) end |
#parent_id ⇒ Object
88 89 90 |
# File 'lib/rbmount/fs.rb', line 88 def parent_id Mount::C.mnt_fs_get_parent_id(@pointer) end |
#passno ⇒ Object
92 93 94 |
# File 'lib/rbmount/fs.rb', line 92 def passno Mount::C.mnt_fs_get_passno(@pointer) end |
#passno=(passn) ⇒ Object
184 185 186 |
# File 'lib/rbmount/fs.rb', line 184 def passno= (passn) Mount::C.mnt_fs_set_passno(@pointer, passn) end |
#prepend_attributes(optstr) ⇒ Object
152 153 154 |
# File 'lib/rbmount/fs.rb', line 152 def prepend_attributes (optstr) Mount::C.mnt_fs_prepend_attributes(@pointer, optstr) end |
#prepend_options(optstr) ⇒ Object
156 157 158 |
# File 'lib/rbmount/fs.rb', line 156 def (optstr) Mount::C.(@pointer, optstr) end |
#print_debug(io) ⇒ Object
160 161 162 |
# File 'lib/rbmount/fs.rb', line 160 def print_debug (io) Mount::C.mnt_fs_print_debug(@pointer, io) end |
#reset! ⇒ Object
216 217 218 |
# File 'lib/rbmount/fs.rb', line 216 def reset! Mount::C.mnt_reset_fs(@pointer) end |
#root ⇒ Object
96 97 98 |
# File 'lib/rbmount/fs.rb', line 96 def root Mount::C.mnt_fs_get_root(@pointer) end |
#root=(path) ⇒ Object
188 189 190 |
# File 'lib/rbmount/fs.rb', line 188 def root= (path) Mount::C.mnt_fs_set_root(@pointer, path) end |
#source ⇒ Object
100 101 102 |
# File 'lib/rbmount/fs.rb', line 100 def source Mount::C.mnt_fs_get_source(@pointer) end |
#source=(src) ⇒ Object
192 193 194 |
# File 'lib/rbmount/fs.rb', line 192 def source= (src) Mount::C.mnt_fs_set_source(@pointer, src) end |
#srcpath ⇒ Object
104 105 106 |
# File 'lib/rbmount/fs.rb', line 104 def srcpath Mount::C.mnt_fs_get_srcpath(@pointer) end |
#tag ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/rbmount/fs.rb', line 108 def tag name = FFI::MemoryPointer.new(:pointer).write_pointer(FFI::MemoryPointer.new(:string)) value = FFI::MemoryPointer.new(:pointer).write_pointer(FFI::MemoryPointer.new(:string)) raise unless Mount::C.mnt_fs_get_tag(@pointer, name, value) [name.read_pointer.read_string, value.read_pointer.read_string] end |
#target ⇒ Object
116 117 118 |
# File 'lib/rbmount/fs.rb', line 116 def target Mount::C.mnt_fs_get_target(@pointer) end |
#target=(targ) ⇒ Object
196 197 198 |
# File 'lib/rbmount/fs.rb', line 196 def target= (targ) Mount::C.mnt_fs_set_target(@pointer, targ) end |
#to_c ⇒ Object
230 231 232 |
# File 'lib/rbmount/fs.rb', line 230 def to_c @pointer end |
#to_mntent ⇒ Object
208 209 210 211 212 213 214 |
# File 'lib/rbmount/fs.rb', line 208 def to_mntent ptr = FFI::MemoryPointer.new(:pointer).write_pointer(FFI::MemoryPointer.new(:pointer)) raise unless Mount::C.mnt_fs_to_mntent(@pointer, ptr) Mount::C::MntEnt.new(ptr.read_pointer) end |
#userdata ⇒ Object
120 121 122 |
# File 'lib/rbmount/fs.rb', line 120 def userdata Mount::C.mnt_fs_get_userdata(@pointer) end |