src/linux_parser.cpp
// TODO: Read and return the command associated with a process
// REMOVE: [[maybe_unused]] once you define the function
Read and return the command associated with a process
REMOVE: [[maybe_unused]] once you define the function
Read and return the command associated with a process REMOVE : [[ maybe_unused ]] once you define the function
string LinuxParser::Command(int pid) {
  std::string command = "";
  std::ifstream filestream(kProcDirectory + "/" + std::to_string(pid) + kCmdlineFilename);
  if (filestream.is_open()) {
    std::getline(filestream, command);
  }
  return command;
}
string LinuxParser :: Command ( int pid ) { std :: string command = " " ; std :: ifstream filestream ( kProcDirectory + " " + std :: to_string ( pid ) + kCmdlineFilename ) ; if ( filestream . is_open ( ) ) { std :: getline ( filestream , command ) ; } return command ; }
TODO: Read and return the command associated with a process
REMOVE: [[maybe_unused]] once you define the function
TODO : Read and return the command associated with a process REMOVE : [[ maybe_unused ]] once you define the function