File locking supported on all platforms?
Stefan Reich
stefan.reich.maker.of.eye at googlemail.com
Sat Jul 11 09:36:55 UTC 2020
Hi,
a quick question regarding file locks in Java. I seem to remember reading
somewhere that this feature isn't guaranteed to work on all platforms.
However, I can now find no mention of that e.g. here
<https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileLock.html>.
The page does list that numerous special assumptions may fail, for example
that programs which *don't* lock a file are prevented from changing it when
it is locked by another program.
However, I only care about the basic feature, namely that one local file
cannot be locked by two Java programs at once and will cause one of them to
throw an exception.
Is this guaranteed to work everywhere?
Many greetings
Stefan
--
Stefan Reich
BotCompany.de // Java-based operating systems
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200711/3bd805fb/attachment.htm>
More information about the nio-dev
mailing list