Created
August 31, 2010 10:12
-
-
Save meineerde/558832 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # run me like ruby binary.rb /PATH/TO/FILE | |
| # this scripts checks if the file contains binary or textual data. | |
| require 'yaml' | |
| FILENAME = ARGV[0] | |
| binary = File.read(FILENAME).is_binary_data? | |
| puts "The file #{FILENAME} contains #{binary ? "BINARY" : "TEXTUAL"} data." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment