
On 14 June 2010 15:10, Beman Dawes <bdawes@acm.org> wrote:
Furthermore, I see the need to output and then roundtrip strings back as input, regardless of embedded whitespace, to be a common need
I think the best kind of << or >> would be ones that prevent "shell script injection attacks". Is there some usable lowest common denominator between the escapes used by various shells? Platform-specific output and a permissive parser might work too. Remembering the Requirement to "Be able to write portable script-style filesystem operations in modern C++" <http://www.boost.org/doc/libs/1_43_0/libs/filesystem/doc/design.htm#Requirements>, there should be some way to stringstream together something that can be safely passed to std::system. Imagine something like this: path p = "-f x"; stringstream ss; ss << delete_program << " " << p; system(ss.str().c_str()); It'd be great if it became system("rm './-f x'"); or similar, avoiding all kinds of pitfalls in the process.