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