Run a fileset scan. This populates the maps m_dirs and m_file, by scanning the directories specified in the map m_Roots. Firstly mark all existing files (those in m_dirs and m_files) for delete before a run. Then during the run the new files will be marked as CREATE and existing files either as MODIFY or NOACTION. Arguments: None

Return TypeFunction nameArguments
hzEcodehzFileset::Scan(void)

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

Function Logic:

0:START 1:items items 2:unknown 3:p 4:unknown 5:items 6:rc 7:unknown 8:Return rc 9:Return E_OK

Function body:

hzEcode hzFileset::Scan (void)
{
   //  Run a fileset scan. This populates the maps m_dirs and m_file, by scanning the directories specified in the map m_Roots.
   //  
   //  Firstly mark all existing files (those in m_dirs and m_files) for delete before a run. Then during the run the new files will be marked as CREATE and existing files either
   //  as MODIFY or NOACTION.
   //  
   //  Arguments: None
   //  
   //  Returns: E_ARGUMENT If the directory name is missing from the fileset root
   //     E_OPENFAIL If the directory cannot be opened
   //     E_CORRUPT If the supplied parent is not a directory or if an listed entity cannot be stated
   //     E_OK  If the directory was scanned successfully
   _hzfunc("hzFileset::Scan") ;
   hzList<hzPair>::Iter    ri ;    //  Roots iterator
   FSTAT       fs ;                //  To check if dir exists
   hzPair      p ;                 //  Name-value pairs being directory and file criteria
   hzString    opdir ;             //  Operations (root) directory.
   hzEcode     rc = E_OK ;         //  Return code
   m_Error.Clear() ;
   _clear() ;
   /*
   **  ** Save the current directory then iterate through the root directories, building the dependancy tree of each.
   **   ** When done return to the original current directory.
   **      */
   for (ri = m_Roots ; ri.Valid() ; ri++)
   {
       p = ri.Element() ;
       if (lstat(*p.name, &fs) < 0)
       {
           m_Error.Printf("Warning: root of %s does not exist\n", *p.name) ;
           continue ;
       }
       rc = _scan_r(0,p.name, p.value) ;
       if (rc != E_OK)
           return rc ;
   }
   return E_OK ;
}