FTPPwd

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO All

Syntax

FTPPwd (socket) Returns server-directory

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This Web command is multi-threaded, allowing another thread to execute in the multi-threaded server while it runs. Note that the same socket cannot safely be used concurrently by more than one thread.

FTPPwd gets the pathname of the current directory on the FTP server.

Socket is an Omnis Long Integer field containing a socket opened to an FTP server using FTPConnect.

ServerDirectory is an Omnis Character field that receives the pathname of the current directory. If this is a number less than zero, an error occurred. Possible error codes are listed in the Web Command Error Codes Appendix.

Note: The value returned depends upon the operating system of the remote server. Many FTP servers return a Linux-style pathname, but do not assume that this is the case.

Example

# return the current working directory on the FTP server
FTPPwd (iFTPSocketReturns lDirectory
If lDirectory<0 ;; an error has occurred
  FTPGetLastStatus (iServerReplyTextReturns lErrCode
  OK message FTP Error {[con("Error obtaining current FTP directory",kCr,"Details follow: ",kCr,iServerReplyText)]}
End If