[Gambas-user] FTPClient

Daniel Campos daniel.campos at ...338...
Thu Nov 18 00:06:35 CET 2004


At this moment, the only thing you can do to know the contents of a
remote folder, is to perform a "Get()" over that folder. That is, Get()
allows you to receive a file, or, if it is applied over a folder, you
will receive the contents. Note that you have to parse the information
received, as it is different when FTP server is an UNIX server, a Win$
server or even a Novell server...

Here's an example (do not forget to use "/" after remote folder name):

PUBLIC SUB Button2_Click()

  DIM sCad AS String 
  
  Ftp.User="fooUser"
  Ftp.Password ="fooPass"

  Ftp.URL="ftp://fooserver.net/myfolder/"
  Ftp.Get()
  
  DO WHILE Ftp.Status >0
      WAIT (0.1)
  LOOP

  IF Ftp.Status < 0 THEN

    Message("Error")
    RETURN
  
  END IF

  READ #Ftp,sCad,Lof(Ftp)
  
  PRINT sCad
  

END

I've sent a patch for the #11 (segmentation fault) error, this is a
problem from the net.curl component, not from the curl library itself.

Regards,

Daniel Campos






More information about the User mailing list