?
Solved

Perl Scripting FTP lock

Posted on 2011-09-19
2
Medium Priority
?
390 Views
Last Modified: 2012-05-12
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
Comment
Question by:ilcapocamorra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
nemws1 earned 2000 total points
ID: 36564727
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
 

Author Closing Comment

by:ilcapocamorra
ID: 36575958
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question