Question

IIS 4.0 FTP server locks my file

Asked by: kawa

WINNT 4.0 + SP6 +ie 5.01

I am using FTP server from IIS 4.0.
I have a C++ application that is adding, updating and deleting files based on a certain time event using FTP commands. In many cases some of my files are locked and I cannot delete or update them. The only way to unlock the files is by stop and re-starting FTP service which is not possible since FTP server is a remote server running on real time for many other real time applications including mine!
Is there any reason for why FTP locks some files?
How can I unlock these files from my code (any language but C++ is prefered)
Thanks a lot.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2000-07-20 at 20:12:50ID10766082
Tags

delete

,

ftp

Topic

Miscellaneous Web Development

Participating Experts
5
Points
500
Comments
13

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. IIS FTP
    Why can't I connect to a server running an IIS FTP site? When not on the machine, I can ping it, but cannot get an ftp connection to it. When on the machine I can get an ftp connection but am not able to logon. OK as of 2/11/00 I can login with a user name of \domain\usern...
  2. IIS Ftp and passwords
    When I use IIS ftp, are passwords sent from client to ftp server in plain text ? If yes, is there a way to configure IIS ftp server to accept password only in secure way like SSH.
  3. IIS and FTP
    I am currently running IIS 6.0 and windows server 2003. I have multiple sites running under one IP address so i use host headers. I need to set up seperate FTP acounts for each site i have but have not one clue on where or how to start. I've got the ftp installed for IIS but ...
  4. ftp on iis
    dear sir , i installed the ftp for iis , by default it takes the directory ftproot , what i want to do is to make ftp allows the administrator accounts to make connection to the ftp only and have the full control , can you tell me step by step how to do that ? thanks

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: campellPosted on 2000-07-21 at 01:03:47ID: 3496594

Ok, this might sound stupid but my experience is that if you rename the file before updating/removing it the ftp server releases it.

Example
a) the file foo.bar is locked by the ftp-server
b) rename the file to _foo.bar
c) now you can delete _foo.bar and make a new foo.bar file

Try it, it might be worth it.

 

by: singletonPosted on 2000-07-21 at 04:06:13ID: 3499055

My guess is it was in the process of doing an FTP update and the connection timed out.

I generally connect to the remote server with PC Anywhere and reboot the server, which fixes the problem, but I can understand how that may not work in your case because of other people using the server.

 

by: GEM100Posted on 2000-07-21 at 05:40:13ID: 3501394

I guess, you should check MaxPoolThreads. If they are not sufficient enough to support trafic,your files may get blocked, and you may not be able to rename them. What happens when you restart service is that you close all other connections and then get your job done before many of them are reestablished. If you don't know how to check MaxPoolThreads, I can give detailed explanation.

 

by: TrentTheThiefPosted on 2000-07-21 at 05:55:13ID: 3501821

Hi,

Your FTP server and Windows will not allow you to overwrite a file that is being downloaded, nor will it allow someone to download a file that you are in the process of uploading. This is a familiar problem for database coders... The old locked-record syndrome ;-)

You need to implement a file-lock check in your application. You'll need to actually check the server response to your STOR command.

These URLs cover the FTP protocol:

http://info.internet.isi.edu/in-notes/rfc/files/rfc959.txt

http://www.cs.rpi.edu/courses/fall96/netprog/lectures/html/ftp/sld001.htm



Cheers.

 

by: kawaPosted on 2000-07-21 at 09:43:09ID: 3508774

Adjusted points from 400 to 500

 

by: kawaPosted on 2000-07-21 at 09:43:09ID: 3508775

Thanks for all of you.
Rename doesn ot work when the file is locked.
The locked files is not actually used by any other threads or applications. For some strange reason, when I try to delete some files (all are identicals) some of them can be deleted and some other are just get locked.
I tested on a single server from which only one client is trying to download/delete/overwrite the files. Still some of the files get locked. There is no overload on FTP server and there are no other application accessing the files.  


I do not know about MaxPoolThreads but it might do the trick. I would appreciate if someone tells me about how to unlock the files using MaxPoolThreads.

Also does this lock expire after sometime or the files will be locked till I stop and restart the service?

Thanks

 

by: GEM100Posted on 2000-07-21 at 10:07:38ID: 3509175

In fact, MaxPoolThread should be increased only if there is some traffic. If only one user uses it, there is no way to correct problem with MaxPoolThread. Anyway, give it a try:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters
then goto Edit, then Add Value, then:
Value Name: MaxPoolThreads
Data Type: REG_DWORD
String: <Range is 0 to 0xFFFFFFFF>

Then close all and Restart.
I highly doubt it will help (knowing the info you gave), so don't try this unless you have no problem with restarting. G-Luck

 

by: GEM100Posted on 2000-07-21 at 10:11:53ID: 3509274

And I have one more idea. Did you try to use some other application for deleteing/updating the files that are locked. May be you C++ prog is not good enough and fails, but other utility will do the job. Try some common ftp prog (personally I prefer AIT2 (Advanced Internet Tool 2) it is freeware allows to work with downloads and have ftp support for upload/download and all common functions, and can be found at www.tucows.com). Or try to get access from DOS prompt. G-Luck

 

by: singletonPosted on 2000-07-21 at 10:40:50ID: 3509635

I doubt it is the C++ program that is causing the problem, because I have seen the same thing with NT4 IIS with people uploading with commercial FTP programs. It does not happen very often, but at least once every few months one of the webmasters from the 30 or so sites we handle for APCUG will email me saying they cant delete or replace a particular file, and I have gone online (using PC Anywhere) and actually tried to delete or rename the file myself, and could not do so, but a reboot of the server always fixes it (i.e. the webmaster can replace the file just with FTP)

 

by: GEM100Posted on 2000-07-21 at 12:42:02ID: 3511158

Is it a bug Micro$oft should fix? May be it is vulnerability? Buffer overflow? Exploitable?

 

by: freshmeatPosted on 2000-07-26 at 23:44:27ID: 3608594

i feel that is NT/IIS FTP Server's bug
i met it serveral times 1 day, when i ftp my files onto server.
but before i use this IIS FTP server, i use Linux/Wu Ftp Server for long time, never get such problem
my client software is the same: CuteFtp.
:)

 

by: GEM100Posted on 2000-09-23 at 06:24:36ID: 4414435

kawa: so what exactly was wrong? Did you accept the closest solution, or the exact one?

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...