Link Details

Link 49920 thumbnail
User 221988 avatar

By krishnas
via javabeat.net
Published: Oct 28 2007 / 06:50

File Locking can be achieved in java by making use of the New I/O API (nio). Before the advent of New I/O API, there was no direct support in Java for locking a file. It is important to understand that File locking is hugely dependent on the native operating system on which the program is executing.
  • 10
  • 6
  • 2304
  • 698

Comments

Add your comment
User 236137 avatar

dzonelurker replied ago:

-1 votes Vote down Vote up Reply

He forgot to mention that the file system must support file locking. Otherwise NIO won't help you. Network file systems usually don't support locking.

User 182366 avatar

Illya Kysil replied ago:

-1 votes Vote down Vote up Reply

Can't see how it is different from JavaDoc.

User 254327 avatar

xcdesz replied ago:

0 votes Vote down Vote up Reply

It's different from javadoc, because not everyone knows that it is even out there. The guy is bringing up the functionality and providing a code sample -- no reason to bash him on that. If you already knew about it, then good for you -- move on.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.