I have a code similar to below. This code works fine on Windows and Linux, but on Mac 10.5 and 10.6 gives java.io.Exceptionopertaion is not supported.
Thanks so much for any help in this regard.
try
{
File file = new File("FILELOCK3");
FileChannel channel = new RandomAccessFile(file, "rw").getChannel();
FileLock lock = null;
try
{
lock = channel.tryLock();
} catch (OverlappingFileLockException e)
{
lock.release();
channel.close();
System.exit(0);
}
} catch (Exception e)
{
}
source
share