Boost logo

Boost :

Subject: [boost] Standard stream from C fopen()
From: Claude (clros_at_[hidden])
Date: 2010-11-12 12:32:27


Hi!

I Use this code for make a standard stream from a C fopen() FILE* :

    FILE *fd = fopen("Prova", "w");
        if (fd)
        {
         
          // io::stream_buffer<io::file_descriptor_source> fpstream
(fileno(fd));
          //std::istream in (&fpstream);

        istream in = boost::iostreams::file_descriptor(fileno(fd));
      }

But I obtain an error (G++ on Linux Ubuntu):

[...]
error: conversion from ‘boost::iostreams::file_descriptor’ to non-scalar
type ‘std::istream’ requested|
[...]
error: call of overloaded ‘path(const int&)’ is ambiguous|
[...]

Why?
What is the correct method?

-- 
View this message in context: http://boost.2283326.n4.nabble.com/Standard-stream-from-C-fopen-tp3040002p3040002.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk