AutoLoadLib/Step02/autoloader.cpp
void checkAndUpdate(std::string const & livefile)
{
  struct stat fileStat;

  if (stat(livefile.c_str(), &fileStat) < 0)
    {
      std::cerr << "Couldn't stat file " << livefile << std::endl;
      return;
    }

  long currUpdateTime = fileStat.st_mtime;
  if (currUpdateTime != prevUpdateTime)
    {
      // std::cout << "#################################" << std::endl;
      // std::cout << "Compile reload" << std::endl;
      recompileAndReload();
    }
  prevUpdateTime = currUpdateTime;
}
// Check if the live file lib.c has changed. If yes, reload it.
Check if the live file lib.c has changed. If yes, reload it.
Check if the live file lib . c has changed . If yes reload it .
void checkAndUpdate(std::string const & livefile)
{
  struct stat fileStat;
  if (stat(livefile.c_str(), &fileStat) < 0)
    {
      std::cerr << "Couldn't stat file " << livefile << std::endl;
      return;
    }
  long currUpdateTime = fileStat.st_mtime;
  if (currUpdateTime != prevUpdateTime)
    {
      recompileAndReload();
    }
  prevUpdateTime = currUpdateTime;
}
void checkAndUpdate ( std :: string const & livefile ) { struct stat fileStat ; if ( stat ( livefile . c_str ( ) , & fileStat ) < 0 ) { std :: cerr << " " << livefile << std :: endl ; return ; } long currUpdateTime = fileStat . st_mtime ; if ( currUpdateTime != prevUpdateTime ) { recompileAndReload ( ) ; } prevUpdateTime = currUpdateTime ; }
Check if the live file lib.c has changed.
Check if the live file lib . c has changed .
// std::cout << "#################################" << std::endl; // std::cout << "Compile reload" << std::endl;