locking a file

i want to read a file . but before that i want to lock the whole file . how to lock a file ?how to do it in linux OS.
[131 byte] By [navigatora] at [2007-10-2 1:49:14]
# 1
Hello,You are probably looking for FileLock class... http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/FileLock.htmlHope this helps
virusakosa at 2007-7-15 19:30:29 > top of Java-index,Java Essentials,Java Programming...