I have to create a program that reads a file that I've created...this part's easy, done...but I also have to have the user input the name of the file in order to grab it. It's partly working lol...I want the program to catch wrong file names...and the program runs with whatever I enter...and it's driving me crazy! Help please!
Here's the code for he helper method getStringFromUser I have in a library I created:
If by that you mean you want to notify user that the path provided doesn't lead to a file:
and the program runs with whatever I enter...
Whatever you enter, your program reads the same file:
No, I want to notify the user that the file name he entered is wrong...oh right, obviously it would lead to the wrong path file for you since I didn't provide the file...but yeah...just that he entered the wrong file name.
I mean, whatever I entered at the prompt for the file name...like, if I enter Halt...it'll display the file anyway. I hope I'm making sense.