tags:

views:

20

answers:

1

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)
{
}
A: 

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.

Andreas_D