I do not have an iMac, but 2 users had the same problem on their iMac when they start my application. The application starts by creating a folder + a file inside it if they are not found, in the user home folder, through this code :
final String FILE_SEPARATOR = System.getProperty( "file.separator" );
File homeFolder = new File( System.getProperty( "user.home" ) + FILE_SEPARATOR + ".testAPP" + FILE_SEPARATOR + "database" );
String dataFilePath = homeFolder.getCanonicalFile() + FILE_SEPARATOR + "data.xml";
if( !homeFolder.exists() ) homeFolder.mkdirs();
File dataFile = new File( dataFilePath );
dataFile.createNewFile(); // Throws IOException
This code throws this exception for both of them at the last line :
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
Is there a specific restriction on iMac that causes this ?
Creating pathes by String concat and FILE_SEPARATOR is an unreliable way. Also mkdirs() execution may fail, therefore it is important to check the return value.
Just try it this way: