dir = dir + File.separator + "tmp";
File tmpDir = new File(dir);
if (tmpDir.isDirectory() == false && tmpDir.mkdirs() == false)
throw new FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.utils.FilePocessId_1"));
for (int i = 0; i < retry; i++)
{
try
{
File f = new File(dir + File.separator+ "pid " + pid);
if (f.createNewFile())
{
f.deleteOnExit(); // problem if we crash?
processId = pid;
break;
}
else
pid++;
}
catch (IOException e)
{
}
}
if (processId == 0)
throw new FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.utils.FilePocessId_2"));
}
}
}
return processId;