src/utils/file.cpp
/**
   * Checks if the given path exists and is a file
   */
Checks if the given path exists and is a file
Checks if the given path exists and is a file
bool is_file(const string& filename) {
    struct stat buffer {};
    if (stat(filename.c_str(), &buffer) != 0) {
      return false;
    }
    return S_ISREG(buffer.st_mode);
  }
bool is_file ( const string & filename ) { struct stat buffer { } ; if ( stat ( filename . c_str ( ) , & buffer ) != 0 ) { return false ; } return S_ISREG ( buffer . st_mode ) ; }
Checks if the given path exists and is a file
Checks if the given path exists and is a file