I am Ftping files between two WinNT servers.  One server is running IIS3.0
and the other is running IIS4.0.  In my script I download a file and then
delete it from the FTP server.  On the server running IIS4.0, the delete 
command is issued and executed, but the file is still there.  After the 
delete command is issued, all the permissions are removed, and the system
has to be rebooted so the permissions are reset.  I have checked all the 
permissions on the directory and files and all seems well.  If I use the 
Net::FTP module, all is well, I can delete from both servers 
successfully.  I decided to go with Win32::Internet because it seems to run 
faster than Net::FTP.  I have attached the transfer subroutine.
Any help would be appreciated.  
Thanks David.
#===============
sub TransferToLocalPc
#===============
{
        my ($FromOption) = shift;
        my ($From,$ErrorCode);
        my $INET = new Win32::Internet() || return "Unable to make a 
connection\n";
        $INET->FTP($From, $IniParams{$FromOption}{Host}, 
$IniParams{$FromOption}{UserName},$IniParams{$FromOption}{Password}) ||die 
"Unable to connect to $IniParams{$FromOption}{Host}\n";
        print $From->GetResponse,"\n";
        $From->Cd($Directory) || die $From->GetResponse;
        print $From->GetResponse,"\n";
        $From->Binary;
        print $From->GetResponse,"\n";
        my @Temp = $From->List($Zipfile,3);
        print "File size = $Temp[0]->{'size'}\n";
        $From->Rename($TriggerFile, $TriggerRename) || die "Unable to rename 
$TriggerFile to $TriggerRename.".$From->GetResponse."\n";
        print $From->GetResponse,"\n";
        $From->Get($Zipfile) || die $From->message."\n";
        print $From->GetResponse,"\n";
        @GetStat = stat($Zipfile);
        if ($GetStat[7] == $Temp[0]->{'size'})
        {
                print "Deleting $Zipfile from $FromOption\n";
                $From->Delete($Zipfile) || die $From->GetResponse;
                print $From->GetResponse,"\n";
                print "Transferring $TriggerRename as $TriggerFile to Local Pc\n";
                $From->Get($TriggerRename, $TriggerFile) || die "Unable to transfer 
$TriggerRename as $TriggerFile:".$From->GetResponse."\n";
                print "Deleting $TriggerRename from $FromOption\n";
                $From->Delete($TriggerRename) || die $From->GetResponse;
                print $From->GetResponse,"\n";
                print "Quitting $FromOption connection\n";
                $ErrorCode = "Ok";
        }
        else
        {
                print "\tUnlinking $Zipfile and $TriggerFile because the transfer to 
the 
local machine failed.\n";
                unlink($Zipfile);
                unlink($TriggerFile);
                $ErrorCode = "Error";
        }
        $From->Close;
        return $ErrorCode;
}

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to