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


FTPDelete (socket,filename[,directory {Default kFalse}]) Returns status


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.

FTPDelete deletes a file or directory on the connected FTP server.

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

Filename is an Omnis Character field containing the pathname of the remote file or directory to delete.

Directory is an optional Boolean (that defaults to kFalse) which you pass as kTrue if Filename is the pathname of a directory rather than a file. Note that a directory may need to be empty before you can delete it.

Status is an Omnis Long Integer field which receives the result of executing the command. Possible error codes are listed in the Web Command Error Codes Appendix.


Calculate lFileName as 'myFileToDelete'
FTPDelete (iFTPSocket,lFileName) Returns lErrCode
If lErrCode
  OK message FTP Error {[con("Error deleting ",lFileName,kCr,"Status code: ",lErrCode)]}
End If