I know this is an old thread but in case anyone else finds this:

Try using boost::iostreams::file_descriptor like this:



int fd = open("filename.txt", O_RDWR);
if (fd == -1) throw "Failed...