ftpDirCurrent (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

2.10 / 1.00.00


This function returns the current working directory on the FTP server.

 

 

Input:

ID : INT

The ID returned from ftpConnect.

 

Returns: STRING

The current directory or empty if an error has occurred (see ftpLastResponse for possible error information).

 

Declaration:

FUNCTION ftpDirCurrent : STRING;
VAR_INPUT
  ID   : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
  open : BOOL;
  host : STRING := "ftp.domain.com";
  usr   : STRING := "ftpuser";
  pwd   : STRING := "user pwd";
 
  id   : INT;
END_VAR;
 
  gsmPower(power := ON);
  gprsOpen();
 
BEGIN
 open := (ftpOpen() = 0);
IF open THEN
    id := ftpConnect(host := host, username := usr, password := pwd);
    DebugMsg(message := "current = '" + ftpDirCurrent(id := id) + "'");
    ftpDisconnect(id := id);
END_IF;
ftpClose();
END;
END_PROGRAM;