"Locking" file access
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Dailous
Posted On:   Monday, November 5, 2001 07:50 AM

I've written a Java application that manipulates the data in a file. Both the application and the file are on a Unix system. The file to be manipulated is first copied from one system. My application monitors the directory where the file is placed, and when the file appears, my application starts it's processing. The problem I'm encountering is sometimes the file is over 100 MB in size, and this takes a while to copy from one system to another system. I don't want my application to begin it's manipulation until the file has completed copying. Is there any way to gain a "lock" for the file, which my application wouldn't be able to obtain until the file was finished being copied? Thanks in advance.    More>>

I've written a Java application that manipulates the data in a file. Both the application and the file are on a Unix system. The file to be manipulated is first copied from one system. My application monitors the directory where the file is placed, and when the file appears, my application starts it's processing.


The problem I'm encountering is sometimes the file is over 100 MB in size, and this takes a while to copy from one system to another system. I don't want my application to begin it's manipulation until the file has completed copying. Is there any way to gain a "lock" for the file, which my application wouldn't be able to obtain until the file was finished being copied?


Thanks in advance.

   <<Less

Re: "Locking" file access

Posted By:   John_Zukowski  
Posted On:   Monday, November 5, 2001 10:18 PM

This is a 1.4 feature. Prior versions of Java don't support file locking.
About | Sitemap | Contact