While i am reading the files inside a directory, I need to lock that particular directory so that no new file get added/deleted. Can anyone please let me know how can i go abt.
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
posted
0
Pre Java 6, you can't do this with Java. You'd have needed to call the operating system, via shell or JNI.
In Java 6, you might find java.lang.File.setWritable() does what you want. However, setting a directory unwritable is neither friendly nor reliable.
You'd be much better off thinking of how your application can be redesigned to cope with normal directory behaviour. [ May 14, 2007: Message edited by: Peter Chase ]
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P