Can someone please tell me how to write a file's path for linux in java. We write for windows as
File file = new File("D:\\testdir\\testfile.txt");
How can we write this path if we are on linux.
posted 9 years ago
In UNIX there is no drive letter as there is in DOS. There is only "root", which is the lowest level of the file structure. Also, in UNIX, the path separator is a forward slash instead of a backslash. Your path, then, would look like this: