Initialize an FTP host or account. This means setting up all the parameters for connecting to an FTP server

Return TypeFunction nameArguments
hzEcodehzFtpHost::Init(hzString&,hzString&,hzString&,hzString&,hzString&,hzString&,)

Declared in file: hzFtpClient.h
Defined in file : hzFtpClient.cpp

Function Logic:

0:START 1:m_Host m_Username m_Password m_Source m_Repos m_Criteria 2:unknown 3:unknown 4:items 5:unknown 6:items 7:unknown 8:items 9:unknown 10:items 11:Return E_ARGUMENT 12:rc 13:unknown 14:Return hzwarn(rc,Failed to assert local dir (%s)\n,*m_Repos) 15:m_bInit 16:Return rc

Function body:

hzEcode hzFtpHost::Init (hzString& host)hzString& user, hzString& pass, hzString& remDir, hzString& locDir, hzString& criteria, 
{
   //  Initialize an FTP host or account. This means setting up all the parameters for connecting to an FTP server
   //  
   //  Arguments: 1) host  The host name
   //     2) user  The username for the account
   //     3) pass  The password to the account
   //     4) remDir  The opening directory on the server (usually /)
   //     5) locDir  The opening directory on the local machine
   //     6) criteria Opening search criteria for listing (if any)
   //  
   //  Returns: E_ARGUMENT If either the hostname, username, password or local directory is not supplied
   //     E_NOCREATE If the local directory does not exist and could not be created
   //     E_OK  If the operation was successful
   _hzfunc("hzFtpSite::Initialize") ;
   hzEcode rc = E_OK ;     //  Return code
   /*
   **  ** Check we have an action, that the action is associated with a publication and that it has an issue date
   **      */
   m_Host = host ;
   m_Username = user ;
   m_Password = pass ;
   m_Source = remDir ;
   m_Repos = locDir ;
   m_Criteria = criteria ;
   if (!host || !user || !pass || !locDir)
   {
       if (!host)      threadLog("No FTP host supplied\n") ;
       if (!user)      threadLog("No FTP username supplied\n") ;
       if (!pass)      threadLog("No FTP password supplied\n") ;
       if (!locDir)    threadLog("No FTP local directory supplied\n") ;
       return E_ARGUMENT ;
   }
   /*
   **  ** Formulate directory to collect files from and assert that directory
   **      */
   rc = AssertDir(*m_Repos, 0755);
   if (rc != E_OK)
       return hzwarn(rc, "Failed to assert local dir (%s)\n", *m_Repos) ;
   m_bInit = true ;
   return rc ;
}