To determine the current directory on the FTP server, you call InetDir, and specify a "GET" operation. Usually, you will do this after you InetConnect() to the FTP server so that you know into which default directory the FTP server has dumped you. You can then navigate around the directory structure from there.

The first arg is the name of the REXX variable where you want the directory name returned. The second arg is "GET".

InetDir will set your variable to the current directory's name.

/* Get the current directory into the variable "dir". */
err = InetDir("dir", "GET")
IF err \== "" THEN SAY err
ELSE SAY dir