Checking a file contains only null bytes Your goal is to write a program or function that takes in as input a string representing the path to a file, and outputs a truthy value if that file is not empty and contains no non-null bytes -- i.e., all bits are 0 -- and a falsey value otherwise.

I realize it is a very simple problem and I guess I could hack
something, but I suspect there must be some short and elegant way of
doing it, and that gave me the idea to make a challenge out of it.

This is code-golf, so shortest code in bytes wins. (My own preference would go to the fastest solution, but that is too implementation dependent...)

Related questions: Pad a file with zeros

Motivation : This is only to tell where the problem comes from, in case you are interested. You do not need to read it.

ISO images of CDs and DVDs, copied with "dd" or other
means, often terminate with a sequence of useless blocks containing
only null bytes. Standard techniques to remove these blocks are known
and simple (see
https://unix.stackexchange.com/questions/74827/ )
but they may sometimes remove non null useful data because the medium
can lie about its own size. So I want to check that the removed
blocks contain only null bytes. Removing these blocks is important for defining a normalised version of ISO-images.
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()))