How to dump STDIN to a file, using C++ STL?
- by Jimm Chen
HHello all, this is a straight forward question, but not a straight forward answer can be found by just Googling today.
Hope someone can show me a concise answer before I dig into those thick C++ books and finally find the solution out. Thank you.
I'm writing this program so to make a workaround in this issue: Why do I get 'Bad file descriptor' when trying sys.stdin.read() in subversion pre-revprop-change py script?
Note:
Content from STDIN may be arbitrary binary data.
Please use C++ STL functions, iostream, ifstream etc .
If the file creation/writing failed, I'd like to catch the exception to know the case.