Method FTPClient():curDir() Professional

Determine or change the current directory on the FTP server.

:curDir( [<cCurrrentDir>] ) --> cOldCurrentDir
The parameter is a character string with the name of the directory to be set as the new current directory on the FTP server. <cCurrentDir> must include the directory name plus path information specified relative to the current directory on the server. Alternatively, the path may be specified as an absolute path. If <cCurrentDir> is not specified, the FTP server's current directory is not changed.

The method returns the previous current directory. In case of an error the return is the empty string ("").


The method :curDir() can be used for changing or determining the current directory on the FTP server. All operations on the remote filesystem which do not have a path specified use the current directory as the default directory.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.