1

Read from stdin or multiple file arguments

view story
linux-howto

http://stackoverflow.com – What my main is supposed to do is either read from stdin using system calls. Or if file arguments are given open the file arguments. I had already coded this to read from one file argument. But now I need it to open from multiple file arguments and I am short on the logic as to how to do this. How would I get my code to be able to open multiple file arguments? int main(int argc, char *argv[]) { char *file_pathname = NULL; int fd; char file_buffer[540]; //Check for proper number of arguments: if(argc < 2) { exit(2); } if(argc < 3) { file_pat (HowTos)