Solved

Perl Scripting FTP lock

Posted on 2011-09-19
2
363 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
2 Comments
 
LVL 23

Accepted Solution

by:
nemws1 earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl split by | 2 97
Question about @INC variable in perl 1 58
Excel to CSV conversion with specific columns 5 80
Perl script to delete older files 6 85
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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now