Created
April 12, 2012 00:25
-
-
Save adamjmurray/2363725 to your computer and use it in GitHub Desktop.
Revisions
-
adamjmurray created this gist
Apr 12, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ class File # Does a case-sensitive check for file existence. # Unlike the normal File.exists? method on OS X with its case-insensitive-by-default FS def self.definitely_exists? path folder = File.dirname path filename = File.basename path # Unlike Ruby IO, ls, and find -f, this technique will fail to locate the file if the case is wrong: not %x( find "#{folder}" -name "#{filename}" ).empty? end end