src/linux_parser.cpp
string LinuxParser::Command(int pid) { 
    string command;
    string line;
    std::ifstream stream(kProcDirectory + "/" + to_string(pid) + kCmdlineFilename);
    if (stream) {
        std::getline(stream,line);
        std::istringstream linestream(line);
        linestream >> command; 
        }
        return command;
    }
// Done: 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;
    string line;
    std::ifstream stream(kProcDirectory + "/" + to_string(pid) + kCmdlineFilename);
    if (stream) {
        std::getline(stream,line);
        std::istringstream linestream(line);
        linestream >> command; 
        }
        return command;
    }
string LinuxParser :: Command ( int pid ) { string command ; string line ; std :: ifstream stream ( kProcDirectory + " " + to_string ( pid ) + kCmdlineFilename ) ; if ( stream ) { std :: getline ( stream , line ) ; std :: istringstream linestream ( line ) ; linestream >> command ; } return command ; }
Done: Read and return the command associated with a process
Done : Read and return the command associated with a process