I get a java.io.IOException: No such file or directory on the following code:
try
{
File newfile = new File(path + filename);
newfile.createNewFile(); // exception thrown here
}
catch (IOException e)
{
System.out.println ("Eerror creating file:" + path + filename);
System.out.println ("\n" + e);
System.exit(-1);
}
The exception occurs when a directory does not exist.
For example, if the path is /home/joeuser/log/
and /log/ doesn't exist, the exception is thrown.
If /log/ exists, but the file does not, no problems.
What do I need to do?