FileDocCategorySizeDatePackage
LockBug.javaAPI DocExample700Mon May 20 03:03:04 BST 2002com.ronsoft.books.nio.channels

LockBug

public class LockBug extends Object
Tickle bug in 1.4.0 with lock() method.
author
Ron Hitchens (ron@ronsoft.com)

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		if (argv.length == 0) {
			System.out.println ("Usage: filename");
			return;
		}

		String filename = argv [0];

		RandomAccessFile raf = new RandomAccessFile (filename, "rw");
		FileChannel fc = raf.getChannel();

		FileLock lock = fc.lock();

		System.out.println ("Exiting");