I was wondering if there is a library or a function that could do the following.
I want to read a file in from the command line argument but only open it if it has the .conf file extension. Of course, it will check for incorrect spelling of the file name itself or if the file is empty.
However, I would like my program to display an error message and terminate if a file without that extension is entered in from the user.