Method: File.magic

Defined in:
lib/magic/core/file.rb

.magic(path, flags = Magic::NONE) ⇒ Object

call-seq:

File.magic( object ) -> string or array
File.magic( string ) -> string or array

See also: File::mime and File::type



12
13
14
# File 'lib/magic/core/file.rb', line 12

def magic(path, flags = Magic::NONE)
  Magic.open(flags) {|mgc| mgc.file(path) }
end