We know if we want to address a file, we could do it to something like this:
// file_path is the path file to current position of program
String address = file_path + File.separator + "output.txt";
But I made a mistake and set file separator twice, like this:
String address = file_path + File.separator + File.separator + "output.txt";
These code are just an example and I get the file path by Java library which is cross platform and there is not any mistake. I show them like this to show my mistake more clearly.
In fact, I want to rename a text file from a_text.txt to b_text.txt but I set two file separator before these names! something like //b_text.txt not /b_text.txt
In Windows there is no error and file could read or edit, but what about in other Operation Systems like Linux, Mac and Solaris?
Since I don't have those systems, I want to know about it. Although I will solve that mistake as soon as possible but I'm curious to know about it anyway.