Using OS specific functions would be more efficient and safer, but with "pure" C++ you can't do better than JL's version as C++ doesn't actually have the concept of a file system.
But then, it does not really matter. Checking if a file exists / is empty is typically done once per file, right at the beginning - unlike i/o which would be in a loop.