CFtpConnection::GetFile causes problem.

I am experiencing a problem in an app.  where I use CFtpConnection::GetFile.  The problem is that the files once touched by GetFile and retrieved won't then delete.  That means not via FTP, not via local network access, and only sometimes when deleting from the local NT Server (4.0 SP5 IIS 4.0)itself.  I am getting an access denied msg in all cases.  Some of the files won't delete ever, short of rebooting.  

When logged on locally as Administrator and I try to take ownership of the file in ?, I get another access denied msg.  Note administrator on this server is a member of the admin group and this group is given change ownership priviledges.   Anyway, Its got me stumped as to why something isn't releasing these file(s).  

Any useful suggestions are greatly appreciated!
TaurusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mikeblasCommented:
Unfortunately, this is a bug in IIS. Last time I asked about it, they said they'd fix it in SP5, but I guess they haven't.

The problem is that IIS maps a view of the file to send it. It takes a long time for that view to fall out of IIS' cache, and the file remains locked throughout that time.

..B ekiM
0
TaurusAuthor Commented:
How long does it take for the file to fall out of the cache?  I have 3 files created over a day ago.  They are still in the ftp dir. and cannot be removed unless I re-boot.  When attempting to take ownership of the files I receive an access denied msg (logged on as admin w/ admin group having change owner permissions).  

Further putting this all in to question is that the ftp part of the app. was working!  I tested it on many occasions.  What has changed recently: 1) the Server was upgraded from a P75 NT 4.0 SP3 & IIS 4 to PII 266 NT 4.0 SP 5 & IIS 4.  2) The upgraded server's proxy software was re-loaded 3) The machine I develop the app. on changed from NT workstation to W98 re-installing VC 5.0 and SP3.  

With the exception of 1) none should be relevant.

0
mikeblasCommented:
> How long does it take for the file to fall out of the cache?  

It depends on the amount of memory on the machine and the load on the server.

 > I receive an access denied msg

In this case, access is denied because another user has the file locked, not because you don't have rights to the file.

See KB article Q182006 for the official description of one flavor of this problem, and Q182626 for another flavor. A third variant is described in Q186802.  

..B ekiM
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

TaurusAuthor Commented:
I uploaded SP6 (avail. since Oct. 28th) and the problem seems to have gone away again so perhaps you are correct in the first place partially.  I know that it was working with SP3 so I guess it unfixed itself?  

Per my question about uncaching the machine has 128MB of ram and isn't very busy.  The files that were "accessed denied" didn't ever appear to be accessible even after a couple of days.  

I looked at each of the KB Articles you mentioned. Q182626 was one I already dealt with.  The MS suggested work around for that one wasn't at all bullet proof and I had to do a few hours of extra work to get around it safely (after figuring what the problem was -- several more hours).  Per the other two KB articles -- Not exactly my problem but close.  This leaves me wondering if IIS can be relied upon at all?  What does MS use in its products that use ftp and does MS use IIS for its sites?

I'll close this question following your response.
0
TaurusAuthor Commented:
I thought I'd post the psuedocode for ugly work-around I had to impliment per KB article -- Q182626 "Access Is Denied When Attempting to Put Files on FTP Server"

Create 5 STL string  sets to hold  filenames(pseudo code):

Enumerated_Set //holds the file names from the non-local directory
Downloaded_Set//holds the file names of files successfully downloaded
ToDelete_Set//holds the file names of files to be deleted
Deleted_Set// holds the file names of files that the remove function returned a success flag for, but that are not yet deleted
VerifiedDeleted_Set//holds the names of files that are verified to be deleted when re-enumerating the files in the ftp directory.

Re-entrant about every 5 seconds
 |
 V
Clear Enumerated_Set
Clear VerifiedDeleted_Set
Enumerate ftp directory and add returned  filenames to Enumerated_Set
 |
 V
For each filename in Deleted_Set// first iteration thru this set should be empty
{
   If filename is not in Enumerated_Set
   {
       //its not there so IIS must have deleted it!
       Add filename to VerifiedDeleted_Set
   }
}

For each filename in VerifiedDeleted_Set//first iteration thru this set should be empty
{
   Delete filename from Deleted_Set
   Delete filename from DownLoaded_Set
}
 |
 V
For each filename in Enumerated_Set
{
   If filename is not in Downloaded_Set//if its in this set its already been downloaded
   {
       success = GetFile(filename)//download
   }
   If(success)
   {
       Add Filename to Downloaded_Set
       Add Filename to ToDelete_Set
   }
}
 |
 V
For each filename in ToDelete_Set
{
   success = Remove(Filename)
    If(success)
   {
       Add to Deleted_Set
   }
}
For each filename in Deleted_Set
{
   If ToDelete_Set is not empty
   {
       Delete filename from ToDelete_Set
   }
}
 |
 V
           Return
0
TaurusAuthor Commented:
My above psuedo code is for enumerating, then downloading, then deleting the files on a ftp site.  

The KB article Q182626 describes the problem for uploading rather than downloading files.  However the problem that the IIS FTP server caches the file handles and won't delete the file immediately when commanded is essentially the same issue.
0
mikeblasCommented:
> the machine has 128MB of ram and isn't very busy.
 > The files that were "accessed denied" didn't ever
 > appear to be accessible even after a couple of days.  

Indeed, in such a situation, the file would be cached nearly forever. With little activity on the machine, there's little reason for the server to push the file out of memory.

..B ekiM

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.