I had the same problem and my script would fail after about 16 FTP files
uploading.
Now I can upload over 50 files with no problem...
All I did to fix the problem was 
change from the IP address to the DNS name and the problem went away.
Somehow, the way REBOL uses FTP, it seems to open less connections
when you use the DNS name, rather than the actual IP address.
 
Instead of using ftp://scrooge:[EMAIL PROTECTED]
<ftp://scroogeser:[EMAIL PROTECTED]>  
try using ftp://santa:[EMAIL PROTECTED]
<ftp://santa:[EMAIL PROTECTED]> 
 
See if that works better. 


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 20, 1999 8:20 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] FTP Problem - Multiple Connections



I have a problem that I hope can be solved.  I operate several websites and
would like to make a script to upload the site data whenever there is a
change.  My goal is to use Rebol. 

I wrote the script below to move an entire site at once.  I tested uploading
to one of my internal servers (at home) and it worked like a champ.  So, I
then went to upload my data to my real website and I received an error
stating that only one {1} FTP connection was allowed at any given time. 

Because of that, I went back to my internal servers and monitored the FTP
connections, and sure enough, 5 Connections were generated by the script
below (it moves about 30 files in total - a very small, test website).
These connections persisted until I shutdown Rebol. 

My question is, how do I open an FTP connection, write to that connection as
many times as I like, and then close that connection, all while maintaining
only one {1} connection to the FTP Server? 

Thank-you, 
Victor Mascari 



............................... 
 REBOL SCRIPT TO MOVE THE SITE - maybe the error is in my code? 
............................... 

REBOL [ 
Title: "MOVE SITE" 
Date:  1999-12-10 
] 

trace/net true 


site: ftp://NAME:[EMAIL PROTECTED] 

local: %//localsitefiles/ 
baselevel: 1 

getIndentString: function [level] [indentstring ] 
[ 
     indentstring: "" 
     return repeat count level [ append indentstring "." ] 
] 

senddir: function [dest srcdir level istring] [ newsrc newdst nextlevel ] 
[ 
     nextlevel: level + 1 

        print [" "] 
     print ["" srcdir] 

     foreach file read/binary srcdir     [ 
          either dir? srcdir/:file 
          [ 
                use [newsrc newdst] 
                [ 
                        newsrc: srcdir/:file 
                        newdst: dest/:file 
                       newindent: getIndentString level 
                       senddir newdst newsrc nextlevel newindent 
                ] 
          ][ 
                     print [istring :file] 
                write/binary dest/:file read/binary srcdir/:file 
          ] 
     ] 
] 


istring: getIndentString 1 
senddir site local baselevel istring 







Reply via email to