blob: 008dbf78d72f5908661e3e5b72b79cbc0857b707 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <iostream>
#include <fstream>
using namespace std;
int
main (int argc, char* argv[])
{
if (argc != 2)
{
cerr << "usage: " << argv[0] << " <file>" << endl;
return 1;
}
ifstream ifs (argv[1], ifstream::in | ifstream::binary | ifstream::ate);
if (!ifs.is_open ())
cerr << "unable to open " << argv[1] << endl;
if (ifs.tellg () == 0)
cerr << argv[1] << " is empty" << endl;
return 0;
}
|