SetFTPDirectory()

Syntax

Result = SetFTPDirectory(#Ftp, Directory$)
Description
Changes the current #Ftp directory, relative to the current directory.

Parameters

#Ftp The connection to use.
Directory$ The directory to change to. This parameter must refer to a directory inside the current FTP directory. Nested paths are not allowed. Use the value ".." to return to the parent directory of the current directory.

Return value

Returns nonzero if the operation was successful and zero if it failed.

Remarks

To get the current FTP directory, use the GetFTPDirectory() function.

Example

  InitNetwork()
  
  If OpenFTP(0, "ftp.free.fr", "anonymous", "")
    
    Debug "Successfully connected"
    
    If SetFTPDirectory(0, "pub")
      If SetFTPDirectory(0, "Linux")
        Debug "Cool, changed to '/pub/Linux'"
        Debug GetFTPDirectory(0)
      Else
        Debug "Can't change to '/pub/Linux'"
      EndIf
    Else
      Debug "Can't change to 'pub'"
    EndIf
    
  Else
    Debug "Can't connect to ftp.free.fr"
  EndIf  

See Also

GetFTPDirectory(), ExamineFTPDirectory(), SendFTPFile(), ReceiveFTPFile()

Supported OS

All

<- SendFTPFile() - Ftp Index