Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/proutils/rtar/rtar.rb

Class Method Summary collapse

Class Method Details

.gzip?(file) ⇒ Boolean

Is a file a gzip file?

Returns:

  • (Boolean)


38
39
40
41
42
43
44
# File 'lib/proutils/rtar/rtar.rb', line 38

def self.gzip?( file )
  File.open(file,'rb') { |f|
    return false unless f.getc == 0x1f
    return false unless f.getc == 0x8b
  }
  true
end