I have the code that similar to below. This code works fine on Windows and Linux but on Mac 10.5 and 10.6 gives java.io.Exception
opertaion not supported.
Many thanks 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)
{
}
From another source I get the impression that the error depends on the underlying file system:
Apple has not implemented file locking feature on a few selected file systems.
... and the referenced message was posted in May 2005.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With