12 using namespace xstream;
15 int main(
int argc,
char* argv[]){
20 fd =
open(argv[1], O_WRONLY|O_CREAT);
27 os.exceptions(ios::badbit);
32 cerr<<argv[0]<<
" file"<<endl;
36 cerr<<
"Error: "<<e.what()<<endl;
textOut open("gains.txt")
C++ streambuf to work with file descriptors.
file descriptor streambuf
int main(int argc, char *argv[])