• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

Perl Scripting FTP lock

Hello,

I have  a small PERL script that downloads files via FTP.  The issue is that this script locks the file while downloading meaning that the person on the other side can not write to it (it is a text file) while the script is downloading the file.

Can someone help unlock his file??
0
ilcapocamorra
Asked:
ilcapocamorra
1 Solution
 
nemws1Commented:
That is typical behavior.  When a file is being read, it usually has a READ lock placed on it, so others can read it as well, but nobody can write to it.  If a file has a WRITE lock placed on it, nobody can read or write to it until the lock is cleared.

Usually in a case like this, I'll make a copy of the original file that can be read from while the original is free to be written to.

For example, if the file you're trying to download is named "log_file.1", make a copy of it on the server side named "log_file.1-downloadable".  Then your script can download it and take as much time as it wants.  The file "log_file.1" can still be written to on the server side.  After you are down downloading your copy, you can delete it (or request that it be deleted).

Of course, I don't know what/who is controlling the server you're accessing - they may not be willing to help set this up for you.
0
 
ilcapocamorraAuthor Commented:
This solution works, but would like to be able to copy without having to put a read lock on the file but looks like I have to always :(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now