I have a java program that syncs the content of two directories. The program takes the two directories as arguments.
I created a shell script to run the program on Linux. When the program firsts runs it creates a .sync file in each directory, this work perfectly on windows but is causing me some issues on linux. I'm very new to linux so unsure what is really going on.
My program uses the following piece of code to create the .sync file...
FileWriter fileDir1 = new FileWriter(dir1 + "\\.sync");
fileDir1.write(obj.toJSONString());
fileDir1.flush();
fileDir1.close();
When I run the program on linux the files are being created in the same directory as the two directories are located instead of inside the two directories. The resulting files look like this..
dir1\.sync and dir2\.sync
Any help would be great.