src/linux_parser.cpp
// Read and return the command associated with a process
Read and return the command associated with a process
Read and return the command associated with a process
string LinuxParser::Command(int pid) { 
  string command;
  std::ifstream stream(kProcDirectory + to_string(pid) + kCmdlineFilename);
  if (stream.is_open()) {
    std::getline(stream, command);
  }
  return command;
}
string LinuxParser :: Command ( int pid ) { string command ; std :: ifstream stream ( kProcDirectory + to_string ( pid ) + kCmdlineFilename ) ; if ( stream . is_open ( ) ) { std :: getline ( stream , command ) ; } return command ; }
Read and return the command associated with a process
Read and return the command associated with a process
// NOTE: No use for an istringstream because we want the entire line