File Lock - How to lock and unlock a file ? Can we do that for an FTP File?

Hi All,
I like to retrieve a file from the FTP server using Apache Commons Net libraries.
for example if the file size is 20MB. When the file is in the progress of copying or transferring from the FTP server i need to lock the local file which is in our local directory so that no other process will use the same local file which is in the process of copying otherwise partially copied files will be used by another process.
the file should be locked when it was in the progress of copying from the server. I have an automatic process which will access file objects at certain time and try to process the files.
I like to know the simplest and easiest way to lock and unlock a file object locally which is trying to copy a file from the FTP server which is of huge size.
And also i like to know how to lock and unlock a file in general?
Thanks,
J.Kathir

we can set it read only only when it complete finishing the writing.
can we able to make the file as read-only while transferring data to file.
How to achieve it ? pls give me some sample code

Similar Messages

Maybe you are looking for

  • Accounts Verification Center Nightmare. Service Suspended. No Explanation. HELP.

    Yesterday, 9/26, at around 12pm I was trying to access my account to pay my Verizon bill for my internet and TV service. Through multiple attempts I was getting the prompt that my account could not be accessed and so I called technical support and wa

  • U400 Video driver

    Hello, I had a hard drive crash on a Lenove U400, i changed the hard disk drive. I then reinstall Windwos 7 Home prmium 64 on the laptop.  A standard windows 7 home. The I installed the AMD Catalyst driver, from the lenovo driver web page. AMD Graphi

  • Which services in the Server app use PostgreSQL?

    I want to use Postgres.app for PostgreSQL and move my databases currently on the Apple installed instance.  The documentation states that it works best if there is only one active instance of PostgreSQL. I currently use the latest version of the Mave

  • Bug with Date

    While working on a project I've ran across a pretty nasty bug with the Date class in flash. I've tested this in 8.0 Professional and the issue also exists in 9.0 Alpha Release. var d1:Date = new Date(2006, 12, 21); var d2:Date = new Date(2007, 1, 31)

  • 2 questions about this forum

    Since the forums have been reorganized (yeah, I know its been a while).  I never fail to be confused when I try to use them. For instance: 1) At the top of the list of questions for adobe Bridge general discussion, I see the Heading: "Trending Questi