Class: MiniSOReader
- Inherits:
-
Object
- Object
- MiniSOReader
- Defined in:
- ext/oci8/oraconf.rb
Overview
minimal implementation to read information of a shared object.
Instance Attribute Summary collapse
-
#bits ⇒ Object
readonly
Returns the value of attribute bits.
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#endian ⇒ Object
readonly
Returns the value of attribute endian.
-
#file_format ⇒ Object
readonly
Returns the value of attribute file_format.
Instance Method Summary collapse
-
#initialize(filename) ⇒ MiniSOReader
constructor
A new instance of MiniSOReader.
Constructor Details
#initialize(filename) ⇒ MiniSOReader
Returns a new instance of MiniSOReader.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'ext/oci8/oraconf.rb', line 103 def initialize(filename) f = open(filename, 'rb') begin case file_header = f.read(2) when "\177E" # Linux, Solaris and HP-UX(64-bit) read_elf(f) if f.read(2) == 'LF' when "MZ" # Windows read_pe(f) else # HP-UX(32-bit), AIX, Mac OS X and Tru64 raise format("unknown file header: %02x %02x", file_header[0], file_header[1]) end ensure f.close end end |
Instance Attribute Details
#bits ⇒ Object (readonly)
Returns the value of attribute bits.
101 102 103 |
# File 'ext/oci8/oraconf.rb', line 101 def bits @bits end |
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
99 100 101 |
# File 'ext/oci8/oraconf.rb', line 99 def cpu @cpu end |
#endian ⇒ Object (readonly)
Returns the value of attribute endian.
100 101 102 |
# File 'ext/oci8/oraconf.rb', line 100 def endian @endian end |
#file_format ⇒ Object (readonly)
Returns the value of attribute file_format.
98 99 100 |
# File 'ext/oci8/oraconf.rb', line 98 def file_format @file_format end |