Python one-liner to compare two files (conditions apply)
jugad2.blogspot.com
jugad2.blogspot.com
import Data.ByteString.Lazy as LBS
areFilesEqual x y = (==) <$> LBS.readFile x <*> LBS.readFile y
(EDIT: added line break)
Though, in real life you should compare the lengths of the files before reading them.
What language is that? shell? and what is gc?
diff X Y
and check the return code.
Oh you crazy pythonistas.
> diff X Y
For that matter, doing:
cmp X Y
is even simpler since it doesn't create as much output as diff when the files are different. And hey, we saved one letter over diff. /s
According to your logic, no one should have done an alternative version of a program after the first one for that need was created. The world would be a much poorer place. Only one language, assembly or FORTRAN /COBOL, only one OS, one DB, etc.
Poor fellow - you crazy commenter.