Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with do while not eof for ftp program
#11
my buffer is 256
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#12
256 bytes? That's a whole lot smaller than what you first had Smile.

Ok, when I use buffers for fast file reading/writing I usually take buffers with size 1 to 4 kB, because the speed and the memory usage are balanced at that point.

But I'm thus suggesting this:

Code:
DEFINT A-Z

CONST BUFFERSIZE = 4096
CONST PACKET = 0
CONST STARTPACKET = PACKET + 1
CONST STOPPACKET = PACKET - 1

got& = 0

'Send a create-file command to server
SendFTP "ftp://Idontknow", "bla.BAS", STARTPACKET

OPEN "bla.BAS" FOR BINARY AS #1
   flen& = LOF(1)
   DO
      bufsiz = BUFFERSIZE
      IF got& + BUFFERSIZE > flen& THEN bufsiz = flen& - got&
      buffer$ = SPACE$(bufsiz)
      GET #1, , buffer$

      'send  a packet to ftp server
      SendFTP "ftp://Idontknow", buffer$, PACKET

      got& = got& + bufsiz
   LOOP UNTIL got& = flen&

   'tell the ftp server file is completed and can be closed
   SendFTP "ftp://Idontknow", "", STOPPACKET
CLOSE #1

Do you get that Wink?

Btw, SendFTP is a SUB-procedure you write yourself for handling the FTP-command and -protocol etc..
Reply
#13
i don't think you get my ftp program do you. it is a straight link computer to computer.

like running laplink.
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#14
Then I think you can use OUTs to send the messages to the port which the other computer is connected to. The other computer should be running a program then which reads the values transferred and put it back in a file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)