subprocess
subprocess copied to clipboard
Error in the documention
Hello,
In the documentation, this sample doesn't work :
subprocess::command cmd("touch " + file_path.string()).run();
#include <iostream>
#include <filesystem>
#include <subprocess/subprocess.hpp>
using namespace subprocess::literals;
int main()
{
std::filesystem::path file_path{"/tmp/file.txt"};
// error
//subprocess::command cmd("touch " + file_path.string()).run();
// ok
subprocess::command cmd2("touch " + file_path.string());
cmd2.run();
}
When I try to compile, I get this errror on gcc 11 :+1:
main.cpp: In function 'int main()':
main.cpp:12:59: error: expected ',' or ';' before '.' token
12 | subprocess::command cmd("touch " + file_path.string()).run();
|
Is this an error in the documentation?
Jean-Marc