SetFTPDirectory()

语法

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

参数

#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.

返回值

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

Remarks

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

示例

  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  

参阅

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

已支持操作系统

所有

<- SendFTPFile() - Ftp Index