I am trying to create a directory in domino data directory using ssjs that works in all Domino suported OS, like windows and linux etc. I have done the following (not tested)
function getPath(){
var d = session.getEnvironmentString("directory",true)
var s = java.io.File.separator
var path = d + s + "temp"
var dir:java.io.File = new java.io.File(path);
dir.mkdir();
return path;
}
the returned path is later used to store a file in that directory using java. currently I need to add two backlashes on windows to store the file and not sure how that works in other os and how I can make my function returning the path I need depending on the os used.
var filename = getPath() + "file.txt"