#include <ftp.h>
Inheritance diagram for PFTPClient:

Public Member Functions | |
| PFTPClient () | |
| Declare an FTP client socket. | |
| ~PFTPClient () | |
| Delete and close the socket. | |
Overrides from class PSocket. | |
| virtual PBoolean | Close () |
New functions for class | |
| PBoolean | LogIn (const PString &username, const PString &password) |
| PString | GetSystemType () |
| PBoolean | SetType (RepresentationType type) |
| PBoolean | ChangeDirectory (const PString &dirPath) |
| PString | GetCurrentDirectory () |
| PStringArray | GetDirectoryNames (NameTypes type=ShortNames, DataChannelType channel=Passive) |
| PStringArray | GetDirectoryNames (const PString &path, NameTypes type=ShortNames, DataChannelType channel=Passive) |
| PBoolean | CreateDirectory (const PString &path) |
| PString | GetFileStatus (const PString &path, DataChannelType channel=Passive) |
| PTCPSocket * | GetFile (const PString &filename, DataChannelType channel=NormalPort) |
| PTCPSocket * | PutFile (const PString &filename, DataChannelType channel=NormalPort) |
Protected Member Functions | |
| virtual PBoolean | OnOpen () |
| Call back to verify open succeeded in an PInternetProtocol class. | |
| PTCPSocket * | NormalClientTransfer (Commands cmd, const PString &args) |
| PTCPSocket * | PassiveClientTransfer (Commands cmd, const PString &args) |
Protected Attributes | |
| WORD | remotePort |
| Port number on remote system. | |
| PFTPClient::PFTPClient | ( | ) |
Declare an FTP client socket.
| PFTPClient::~PFTPClient | ( | ) |
Delete and close the socket.
| virtual PBoolean PFTPClient::Close | ( | ) | [virtual] |
Close the socket, and if connected as a client, QUITs from server.
Reimplemented from PIndirectChannel.
Log in to the remote host for FTP.
| username | User name for FTP log in. |
| password | Password for the specified user name. |
| PString PFTPClient::GetSystemType | ( | ) |
Get the type of the remote FTP server system, eg Unix, WindowsNT etc.
| PBoolean PFTPClient::SetType | ( | RepresentationType | type | ) |
Set the transfer type.
| type | RepresentationTypeof file to transfer |
Change the current directory on the remote FTP host.
| dirPath | New directory |
| PString PFTPClient::GetCurrentDirectory | ( | ) |
Get the current working directory on the remote FTP host.
| PStringArray PFTPClient::GetDirectoryNames | ( | NameTypes | type = ShortNames, |
|
| DataChannelType | channel = Passive | |||
| ) |
Get a list of files from the current working directory on the remote FTP host.
| type | Detail level on a directory entry. |
| channel | Data channel type. |
| PStringArray PFTPClient::GetDirectoryNames | ( | const PString & | path, | |
| NameTypes | type = ShortNames, |
|||
| DataChannelType | channel = Passive | |||
| ) |
Get a list of files from the current working directory on the remote FTP host.
| path | Name to get details for. |
| type | Detail level on a directory entry. |
| channel | Data channel type. |
Create a directory on the remote FTP host.
| path | Name of the directory to create. |
| PString PFTPClient::GetFileStatus | ( | const PString & | path, | |
| DataChannelType | channel = Passive | |||
| ) |
Get status information for the file path specified.
| path | Path to get status for. |
| channel | Data channel type. |
| PTCPSocket* PFTPClient::GetFile | ( | const PString & | filename, | |
| DataChannelType | channel = NormalPort | |||
| ) |
Begin retreiving a file from the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.
| filename | Name of file to get |
| channel | Data channel type. |
| PTCPSocket* PFTPClient::PutFile | ( | const PString & | filename, | |
| DataChannelType | channel = NormalPort | |||
| ) |
Begin storing a file to the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.
| filename | Name of file to get |
| channel | Data channel type. |
| virtual PBoolean PFTPClient::OnOpen | ( | ) | [protected, virtual] |
Call back to verify open succeeded in an PInternetProtocol class.
Reimplemented from PIndirectChannel.
| PTCPSocket* PFTPClient::NormalClientTransfer | ( | Commands | cmd, | |
| const PString & | args | |||
| ) | [protected] |
| PTCPSocket* PFTPClient::PassiveClientTransfer | ( | Commands | cmd, | |
| const PString & | args | |||
| ) | [protected] |
WORD PFTPClient::remotePort [protected] |
Port number on remote system.
1.5.1