This class defines an interface to the ftp program. Basically it provides filesystem like queries and operations that operate on a remote machine using the ftp program to do the work. More...
#include <ftp.h>
Classes | |
struct | FileInfo |
A FileInfo is a combination of the name of a file and its FileStatus. More... | |
Public Types | |
enum | constants { max_ftp_line_length = 2048 } |
typedef std::string | string |
Static Public Member Functions | |
static bool | del (string host, string user, string password, FileName pathname) |
Use ftp to delete a file on a remote host. | |
static string | error () |
static bool | get (string host, string user, string password, FileName pathname, string to_file="") |
Use ftp binary transfer to retrieve a file from a remote system. You can optionally specify a file name into which to store the result. By default the file node name will be the name of the retrieved file. | |
static bool | parse_ftp_dir_text (char const *buffer, FileStatus *statbuf, FileName *filename) |
Get the text of the most recent error -- if any. | |
static bool | put (string host, string user, string password, FileName pathname, string from_file="") |
Use ftp binary transfer to store a file to a remote system. You can optionally specify a file name from which the file comes. By default the file node name of the target file will be assumed to be the name of the source file (in the current directory). | |
static int | stat_matching (string host, string user, string password, string pattern, std::list< FileInfo > *l) |
Find a list of FileName's matching a specified file name pattern on a remote host using ftp -- get descriptors of those files which contain the file name and status. This is much more efficient than using find_matching followed by a bunch of file_stat calls. | |
static int | stat_matching (char const *host, char const *user, char const *password, char const *pattern, std::list< FileInfo > *output) |
Find a list of FileName's matching a specified file name pattern on a remote host using ftp -- get descriptors of those files which contain the file name and status. This is much more efficient than using find_matching followed by a bunch of file_stat calls. |
This class defines an interface to the ftp program. Basically it provides filesystem like queries and operations that operate on a remote machine using the ftp program to do the work.
Definition at line 39 of file ftp.h.
enum constants |
Use ftp to delete a file on a remote host.
host | the name of the host machine for ftp activity | |
user | the user name on the host machine | |
password | the needed password | |
pathname | the file to delete |
Definition at line 635 of file ftp.cxx.
string error | ( | ) | [static] |
bool get | ( | string | host, | |
string | user, | |||
string | password, | |||
FileName | pathname, | |||
string | to_file = "" | |||
) | [static] |
Use ftp binary transfer to retrieve a file from a remote system. You can optionally specify a file name into which to store the result. By default the file node name will be the name of the retrieved file.
host | the name of the host machine for ftp activity | |
user | the user name on the host machine | |
password | the needed password | |
pathname | the file to replace | |
to_file | local file to store the retrieved file. |
Definition at line 530 of file ftp.cxx.
bool parse_ftp_dir_text | ( | char const * | buffer, | |
FileStatus * | statbuf, | |||
FileName * | filename | |||
) | [static] |
Get the text of the most recent error -- if any.
Convert a string provided by ftp for directory entries into file statuses. Return true if it is a valid entry, false if the text is not correctly formatted. Also, this function returns a pointer to the filename part of the ftp directory text -- so you don't have to figure out where it is yourself.
buffer | line of text provided by the ftp program (given the dir command) for a file status display | |
statbuf | a FileStatus object into which the buffer is parsed | |
filename | the name of the file on the ftp dir output line |
Definition at line 123 of file ftp.cxx.
bool put | ( | string | host, | |
string | user, | |||
string | password, | |||
FileName | pathname, | |||
string | from_file = "" | |||
) | [static] |
Use ftp binary transfer to store a file to a remote system. You can optionally specify a file name from which the file comes. By default the file node name of the target file will be assumed to be the name of the source file (in the current directory).
host | the name of the host machine for ftp activity | |
user | the user name on the host machine | |
password | the needed password | |
pathname | the file to get | |
from_file | the file to put to the ftp server |
Definition at line 420 of file ftp.cxx.
static int stat_matching | ( | string | host, | |
string | user, | |||
string | password, | |||
string | pattern, | |||
std::list< FileInfo > * | l | |||
) | [static] |
Find a list of FileName's matching a specified file name pattern on a remote host using ftp -- get descriptors of those files which contain the file name and status. This is much more efficient than using find_matching followed by a bunch of file_stat calls.
host | the name of the hostmachine to which a query is being done | |
user | the name of the user id to pass to the ftp program | |
password | the password required to get the ftp program to work | |
pattern | the file name pattern to search for | |
l | the list of fileInfo data structures requested by this call |
Definition at line 120 of file ftp.h.
int stat_matching | ( | char const * | host, | |
char const * | user, | |||
char const * | password, | |||
char const * | pattern, | |||
std::list< FileInfo > * | output | |||
) | [static] |
Find a list of FileName's matching a specified file name pattern on a remote host using ftp -- get descriptors of those files which contain the file name and status. This is much more efficient than using find_matching followed by a bunch of file_stat calls.
host | the name of the hostmachine to which a query is being done | |
username | the name of the user id to pass to the ftp program | |
password | the password required to get the ftp program to work | |
pattern | the file name pattern to search for | |
output | the list of fileInfo data structures requested by this call |
Definition at line 248 of file ftp.cxx.