Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (15 sloc) 641 Bytes

Spotting Code

This simple solution describes how to use file and ohcount to compare their abilities to spot text files that are actually code.

n.b. MacPorts has a ohcount package, so installing that way is very easy.

For file, I used

find . -type f -exec file --mime-type {} \; > ../file.txt

For ohcount I used

find . -type f -exec ohcount -d {} \; > ../ohcount.txt

I then reformatted file.txt to use tab separators, imported the data into Excel, generated hit rates and made pie charts.

For more, see

You can’t perform that action at this time.