Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/sixarm_ruby_magic_number_type/file.rb
Class Method Summary collapse
-
.magic_number_type(file_name) ⇒ Object
Detect the file’s data type by opening the file then using IO#magic_number_type to read the first bits.
Class Method Details
.magic_number_type(file_name) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/sixarm_ruby_magic_number_type/file.rb', line 17 def self.magic_number_type(file_name) f = File.open(file_name,"rb") type = f.magic_number_type f.close return type end |