Checking a file contains only null bytes
Pyth, 6 5 bytes
!sCM'

Try it online!
Takes a filename from STDIN, opens and reads the file, converts it to a list of ints (think Python ord) sums the list (will return 0 iff file is all null bytes), and nots the result, printing it.

Hey,
This looks a lot like a general programming question. These belong on Stack Overflow. However, from the comments under the main post, I can see that this was not your intent. That said, I feel that the discussion has been unnecessarily hostile on both sides, so I've decided to pick up the slack and give you the proper PPCG welcome!
Generally, we ask that any challenges are first posted to our sandbox for proper feedback. You can take a look at the current submissions in there to see what format we prefer for challenges. Please give it a try next time!
Just in case we've all misunderstood you and you are looking for a general solution, here's a solution in Python 3:
def main(string):
    with open(string) as file:
        return not any(map(ord,file.read()))