So basically I have this file that my program needs to open called "outfile.txt" and "fort.20.txt". In windows, I have the file located at the root of the C:\\ drive, and the program compiles perfectly. My program goes to the directory like this:
File textfile1 = new File("C:\\outfile.txt");
File textfile2 = new File("C:\\fort.20.txt");
The thing is, my program needs to work on linux as well(Ubuntu specifically). I have a directory on a linux computer called "/home/lcoy" - that is where I would like my files to be stored while running the program on linux. Would I go to the directory just like I did on windows? I imagine it would be something like this:
File textfile1 = new File("/home/lcoy/outfile.txt");
File textfile2 = new File("/home/lcoy/fort.20.txt");
Can someone tell me if this is the proper way to refer to the file directory on a linux system? Thank you for your help.