#include #include #include #include #include using namespace std; int main(){ struct stat info; if(fstat(STDIN_FILENO, &info) < 0){ perror("Error getting info about standard input"); return -1; } cout << "Standard input is owned by user number " << info.st_uid << endl; cout << "and was last modified " << ctime(&info.st_mtime); if(S_ISREG(info.st_mode)){ cout << "It is a " << info.st_size << "-byte file." << endl; } else { cout << "It is not a regular file." << endl; } return 0; }