|
Folks:
The code I'm using is pretty simple ...
FileLock lock = null; File lockFile = null; // make sure another instance of the server isn't running try { lockFile = new File(LOCK_FILE); if (!lockFile.exists()) { lockFile.createNewFile(); } lock = new FileOutputStream(lockFile).getChannel().tryLock(); } catch (IOException e) { String msg = MessageFormat.format(MC.getMessage("LOCK_ERR"), new String[] { e.getMessage() }); System.err.println(msg); e.printStackTrace(System.err); System.exit(ALREADY_RUNNING_EXIT); }
Any suggestions on what could be going wrong?
Thanks!
david
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.