Code is not reading in input file

Nov 23, 2015 at 6:16pm
D
Last edited on Nov 23, 2015 at 7:58pm
Nov 23, 2015 at 6:20pm
Perhaps your input file is in the wrong location. It needs to be in the current working directory, which can be different depending on how you're running the program. If you're running the program from inside an IDE then the input should probably be in the same directory as the project files. If you're running the program from the command line then the input file needs to be in the directory from which you're running the program.

Nov 23, 2015 at 6:26pm
I am running the program from the command line and the input file is in the same directory from which I am running the program. I also have the input file as part of my project resource files. I am still not able to open my input file and my program simply terminates.
Nov 23, 2015 at 6:31pm
When you say the program simply terminates, you mean it prints "Error Opening File" and that the program terminates with an exit code of 1, right?

What operating system are you using?

Have you issued either the "dir" or "ls -l" command from that directory to insure the file is actually in the directory?

Nov 23, 2015 at 6:35pm
Right, so my program prints "Error Opening File" and the program terminates with the exit code of 1.

I am using the windows operating system on my Mac via Parallels.

I have not issued either the "dir" or "ls -l". I haven't learned what those are and so I am not familiar with it.
Nov 23, 2015 at 6:38pm
Those are commands to list the directory contents. If you're running Windows you'll type "dir" then press enter and you should see a directory listing.

Topic archived. No new replies allowed.